diff options
-rw-r--r-- | src/corelib/fpg_base.pas | 17 | ||||
-rw-r--r-- | src/corelib/fpg_imgfmt_bmp.pas | 2 |
2 files changed, 11 insertions, 8 deletions
diff --git a/src/corelib/fpg_base.pas b/src/corelib/fpg_base.pas index b0c4acee..3bd9bfbd 100644 --- a/src/corelib/fpg_base.pas +++ b/src/corelib/fpg_base.pas @@ -195,7 +195,7 @@ type public constructor Create; destructor Destroy; override; - procedure Invert; + procedure Invert(IncludeMask: Boolean = False); procedure FreeImage; procedure AllocateImage(acolordepth, awidth, aheight: integer); procedure AllocateMask; @@ -1950,7 +1950,7 @@ begin inherited Destroy; end; -procedure TfpgImageBase.Invert; +procedure TfpgImageBase.Invert(IncludeMask: Boolean); var p: ^byte; n: integer; @@ -1965,13 +1965,16 @@ begin Inc(p); end; - if FMaskData <> nil then + if IncludeMask then begin - p := FMaskData; - for n := 1 to FMaskDataSize do + if FMaskData <> nil then begin - p^ := p^ xor $FF; - Inc(p); + p := FMaskData; + for n := 1 to FMaskDataSize do + begin + p^ := p^ xor $FF; + Inc(p); + end; end; end; end; diff --git a/src/corelib/fpg_imgfmt_bmp.pas b/src/corelib/fpg_imgfmt_bmp.pas index b373e724..48b25d5b 100644 --- a/src/corelib/fpg_imgfmt_bmp.pas +++ b/src/corelib/fpg_imgfmt_bmp.pas @@ -217,7 +217,7 @@ begin //Writeln(linecnt,' lines loaded.'); move(img.ImageData^, img.MaskData^, img.ImageDataSize); - img.Invert; + img.Invert(True); end; 4: |