I decided to extend class TLazIntfImage to make it possible to export
picture to TBitmap for displaying on screen:
TLazIntfImageExtended = class(TLazIntfImage)
private
itsThreshold : TFPColor;
itsGrayScale : Boolean;
public
constructor Create( _Width, _Height : Longword );
constructor CreateFromBitmap( _BMP : TBitmap );
procedure TurnToGrayScale;
procedure ThresholdFilter;
function GetBitmap : TBitmap;
property GrayScale : Boolean read itsGrayScale write itsGrayScale;
end;
function TLazIntfImageExtended.GetBitmap : TBitmap;
var
OutBMP : TBitmap;
ImgHandle,
ImgMaskHandle : HBitmap;
begin
OutBMP := TBitmap.Create;
Self.CreateBitmap( ImgHandle, ImgMaskHandle, false );
OutBMP.SetHandles( ImgHandle, ImgMaskHandle );
Result := OutBMP;
end;
But on "OutBMP.SetHandles( ImgHandle, ImgMaskHandle );" execution
stops.
Also i tried to assign property OutBMP.Handle := ImgHandle. Result is
the same.
I don't understand why FadeIn example works, but this method - not?
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives