[ Show ]
Support VoyForums
[ Shrink ]
VoyForums Announcement: Programming and providing support for this service has been a labor of love since 1997. We are one of the few services online who values our users' privacy, and have never sold your information. We have even fought hard to defend your privacy in legal cases; however, we've done it with almost no financial support -- paying out of pocket to continue providing the service. Due to the issues imposed on us by advertisers, we also stopped hosting most ads on the forums many years ago. We hope you appreciate our efforts.

Show your support by donating any amount. (Note: We are still technically a for-profit company, so your contribution is not tax-deductible.) PayPal Acct: Feedback:

Donate to VoyForums (PayPal):

Login ] [ Contact Forum Admin ] [ Main index ] [ Post a new message ] [ Search | Check update time | Archives: 1234567[8]910 ]

[ Next Thread | Previous Thread | Next Message | Previous Message ]

Date Posted: 07:28:37 01/04/01 Thu
Author: Michel
Subject: Re: Draw in bitmap - 256 color palette
In reply to: Poul Halgaard 's message, "Re: Draw in bitmap - 256 color palette" on 15:37:40 01/03/01 Wed

Hi Poul,

If you want to display it, I would leave it as a true color bitmap. Handling images with palettes is always more difficult.

You can copy a Bitmap to a BitmapGraphic by using,

Bitmap.Assign(BitmapGraphic) but the Bitmap will be converted to a 24 bit bitmap in the TDibGraphic.AssignTo method. If you really want to have the displayed bitmap in 8 bit format, saving to a memory stream the BitmapGraphic then loading from the stream the Bitmap is probably more problem free than using the TBitmap.PixelFormat = pf8bit. As mentionned in the Delphi help on TBitmap, the PixelFormat is often used when you want to access the scan lines of the bitmap.

This would be another approach, set Bitmap.PixelFormat to pf8bit and copy the scan lines from the BitmapGraphic to the Bitmap. But using a memory stream is easier.

Best regards,


>Thanks for the suggestion, however I really would like to be able to use TBitmap and not TBitmapGraphics. <BR>
>* I don't want to use TBitmapGraphics instead of TBitmap because that would tie me more to your lib for no reason.<BR>
>* It does not apply very well to the real world situation where I want to use it. I actually want to display it and not save it.<BR>
>Is it possible or should I save a TBitmapGraphic's bitmap in a mem stream and then load it from a TBitmap (hope that's not nessesary)? <BR>
>Kind Regards <BR>
>Poul Halgaard<BR>

[ Next Thread | Previous Thread | Next Message | Previous Message ]


[ Contact Forum Admin ]

Forum timezone: GMT-5
VF Version: 3.00b, ConfDB:
Before posting please read our privacy policy.
VoyForums(tm) is a Free Service from Voyager Info-Systems.
Copyright © 1998-2019 Voyager Info-Systems. All Rights Reserved.