Lazarus

Programming => Graphics and Multimedia => Graphics => Topic started by: wile64 on May 21, 2007, 03:38:22 pm

Title: Image format in HBitmap
Post by: wile64 on May 21, 2007, 03:38:22 pm
Hello,

How are to store the images in HBitmap of TBitmap?
In what format?
Title: RE: Image format in HBitmap
Post by: antonio on May 21, 2007, 07:18:18 pm
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.
Title: Image format in HBitmap
Post by: wile64 on May 21, 2007, 09:13:50 pm
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...) ?   :?:
Title: Image format in HBitmap
Post by: antonio on May 21, 2007, 10:45:18 pm
I found this link: http://www.fortunecity.com/skyscraper/windows/364/bmpffrmt.html , have a look at it.
Title: Image format in HBitmap
Post by: wile64 on May 21, 2007, 11:22:08 pm
thank you,

I seek information on pointer of data HBITMAP not on the files Bitmap (bmp)
Title: Image format in HBitmap
Post by: antonio on May 21, 2007, 11:52:45 pm
You could search on MSDN, http://msdn2.microsoft.com/fr-fr/default.aspx
Title: Image format in HBitmap
Post by: Marc on May 22, 2007, 10:46:40 am
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.
Title: Image format in HBitmap
Post by: wile64 on May 22, 2007, 11:19:14 am
How to reach directly the data image in TBitmap ?  :twisted:
Title: Image format in HBitmap
Post by: theo on May 22, 2007, 11:47:17 am
You can access individual Pixels using TLazIntfImage.
See http://wiki.lazarus.freepascal.org/Developing_with_Graphics#A_fading_example .
Title: Image format in HBitmap
Post by: Marc on May 22, 2007, 11:47:27 am
What data do you mean ?
Title: Image format in HBitmap
Post by: wile64 on May 22, 2007, 12:00:36 pm
it seems to me:
an image is to charge by the SetHandles procedure in FHandle
Title: Image format in HBitmap
Post by: Marc on May 22, 2007, 06:17:47 pm
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.
Title: Image format in HBitmap
Post by: wile64 on June 15, 2007, 09:16:39 pm
Thank Marc,

In me classes :

TFPReaderPCX = class (TFPCustomImageReader)

procedure InternalRead  (Stream:TStream; Img:TFPCustomImage); override;

Or go my image after on load in Img ?
Title: Image format in HBitmap
Post by: Marc on June 18, 2007, 10:32:16 am
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.
Title: Image format in HBitmap
Post by: wile64 on June 18, 2007, 12:06:12 pm
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 ?
Title: Image format in HBitmap
Post by: felipemdc on June 18, 2007, 01:58:55 pm
Quote from: "wile64"
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
Title: Image format in HBitmap
Post by: wile64 on June 20, 2007, 05:29:08 pm
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:
TinyPortal © 2005-2018