Docs: LCL/intfgraphics. Fixes errors in example code. Issue #40970.

* Discussion in  https://forum.lazarus.freepascal.org/index.php/topic,67369.msg518241.html.

(cherry picked from commit 5b84fae03d)
This commit is contained in:
dsiders 2024-05-23 18:50:33 +01:00
parent 84ac965aeb
commit dae0c545d3

View File

@ -149,7 +149,9 @@ Author: Mattias Gaertner
</element>
<element name="TLazIntfImage">
<short>Represents a graphical image.</short>
<short>
Represents a graphical image.
</short>
<descr>
<p>
TLazIntfImage is a <var>TFPCustomImage</var> descendant which stores the
@ -178,13 +180,13 @@ deal with direct interface to the operating system at the pixel level.
// create the raw image
IntfImg1:=TLazIntfImage.Create(0,0);
// get the description for the current screen (bitsperpixel, depth, ...)
IntfImg1.GetDescriptionFromDevice(0);
IntfImg1.DataDescription := GetDescriptionFromDevice(0);
// create the XPM reader
Reader:=TLazReaderXPM.Create;
// load the image
IntfImg1.LoadFromFile('filename.xpm',Reader);
// create the bitmap handles
IntfImg1.CreateBitmap(BmpHnd,MaskHnd);
IntfImg1.CreateBitmaps(BmpHnd,MaskHnd);
// apply handles to the Bitmap1
Bitmap1.Handle:=BmpHnd;
Bitmap1.MaskHandle:=MaskHnd;
@ -192,7 +194,7 @@ deal with direct interface to the operating system at the pixel level.
Reader.Free;
IntfImg1.Free;
// do something with the Bitmap1
...
// ...
end;
</code>
<p>
@ -205,7 +207,7 @@ deal with direct interface to the operating system at the pixel level.
IntfImg1: TLazIntfImage;
Writer: TLazWriterXPM;
begin
...
// ...
// create the raw image
IntfImg1:=TLazIntfImage.Create(0,0);
// load the raw image from the bitmap handles
@ -217,9 +219,9 @@ deal with direct interface to the operating system at the pixel level.
// clean up
Writer.Free;
IntfImg1.Free;
...
// ...
end;
}
</code>
</descr>
<seealso/>