Lazarus
Programming => Graphics and Multimedia => Graphics => Topic started by: wile64 on May 21, 2007, 03:38:22 pm
-
Hello,
How are to store the images in HBitmap of TBitmap?
In what format?
-
You create a bitmap (format: bitmap) at run time, set height and width and you can load from file, save to file, etc, or simply draw or write to it.
-
I can use a bitmap, thank you ! :D
My question is, Which is the format of the data in HBitmap :!:
ex :
header, Image Data (rgb, bgr, rgba...) ? :?:
-
I found this link: http://www.fortunecity.com/skyscraper/windows/364/bmpffrmt.html , have a look at it.
-
thank you,
I seek information on pointer of data HBITMAP not on the files Bitmap (bmp)
-
You could search on MSDN, http://msdn2.microsoft.com/fr-fr/default.aspx
-
That info will be only for real HBITMAP handles returned by windows. There is no guarantee what so ever that it is compatible with lazarus.
A handle is an abstract pointer so some object. How it is internally structured is of no importance to a user of that handle.
-
How to reach directly the data image in TBitmap ? :twisted:
-
You can access individual Pixels using TLazIntfImage.
See http://wiki.lazarus.freepascal.org/Developing_with_Graphics#A_fading_example .
-
What data do you mean ?
-
it seems to me:
an image is to charge by the SetHandles procedure in FHandle
-
the Handle of a TBitmap is only a "utility" for the LCL to communicate with the Widgetset. For normal usage you don't need to worry about it (like every other handle)
If you want to draw something, create a TBitmap, set its Width/Height and start drawing using a canvas.
If you want to load an image, use LoadFrom... functions.
If you want a TBitmap to display on a form, put a TImage on a form, and assign its picture property.
If you want the RawImagedata, use a TLazIntfImage.GetRawImage
This is why I ask what you want to do with the handle.
-
Thank Marc,
In me classes :
TFPReaderPCX = class (TFPCustomImageReader)
procedure InternalRead (Stream:TStream; Img:TFPCustomImage); override;
Or go my image after on load in Img ?
-
the imagereaders are used by FPImage (or LazIntfImage). For each pixel, FPImage.Setpixel is called. LazIntfImage writes those to memory, which you can retrieve/access using a rawimage.
This is internally used by bitmap to load some graphic formats.
-
Hello Marc,
I have to create units of loading of file image pass from there by from TFPCustomImageReader and TFPCustomImagewriter.
My question is to know if I can charge of the images more directly ?
One can like Delphi with scanline and of being able to reach it for the modifiers.
It also seems to to me that the pallets are not to support ?
-
My question is to know if I can charge of the images more directly ?
The support for this is only partial. You can use TLazIntfImage as already said.
Or, use another graphics component, such as:
http://wiki.lazarus.freepascal.org/LazRGBGraphics
-
Thanks Sekel,
I already saw component it LazRGBGraphics but I do not believe that it functions on all the platform.
And I prefer to await Graphics32 ! :lol: