Board index » delphi » bmDDB-Bitmap in 24 Bit???

bmDDB-Bitmap in 24 Bit???

Is it possible to Create a DDB-bitmap in 24 bit???

Whith Delphi 4, when I simply create a bitmap it is
device-dependent. Assigning it a pixelformat makes
it device-independent.Can this be avoided? I tried
to understand the underlying principle from the
implementation of TBitmap in graphics.pas, but that's
too much for me...

Any help would really be appreciated!

Ralf

 

Re:bmDDB-Bitmap in 24 Bit???


Hi Ralf,

Quote
>Is it possible to Create a DDB-bitmap in 24 bit???

>Whith Delphi 4, when I simply create a bitmap it is
>device-dependent. Assigning it a pixelformat makes
>it device-independent.Can this be avoided? I tried
>to understand the underlying principle from the
>implementation of TBitmap in graphics.pas, but that's
>too much for me...

>Any help would really be appreciated!

A device dependent bitmap, as its name implies, has an internal format that
matches exactly the device format, so you can't decide wich format to use.
If the video driver is set to 24 bpp then a DDB will use 24 bpp, but if the
video driver is set to 8 bpp, for example, a DDB will use 8 bpp. If you set
a TBitmap to pf24bit it will change to a DIB because that's how Windows API
works.

Hope it helps,
Francisco Sanchez
formcontai...@apdo.com
http://www.teemach.com/formcontainer

Re:bmDDB-Bitmap in 24 Bit???


"Ralf C. Hoffmann" <p...@yahoo.com> wrote:

Quote
>Is it possible to Create a DDB-bitmap in 24 bit???

Francisco gave you the right answer.  What I would like to ask is why you
believe you want this?

- Tim Roberts, t...@probo.com
  Providenza & Boekelheide, Inc

Re:bmDDB-Bitmap in 24 Bit???


I'm writing a component for HTML-like files that should
be able to display both graphics and text. For some nice
graphic routines (smooth edges of rounded pictures etc.)
I need (fast) access to the image data - ideally in 24 bit.
For the text I would like to use the Windows font anti-
aliasing, which I found out works only with DDBs, not
with DIBs (?). Therefore I am looking for a way to have
both. Right now I use a workaround : both a DIB for the
background graphics and effects and a DDB for the text.
Before I print the text, I draw the DIB to the DDB. The
bad thing is, though, that it takes up quite a bit of memory
and some time for the Draw-operation, but so far, I have
not found a better way...

Any ideas would really be appreciated!

Ralf

Other Threads