Board index » delphi » 8 bit and 24 bit bitmap problem ....

8 bit and 24 bit bitmap problem ....

Hi,

        I have written a program which loaded a bitmap to a timage
and then cut part of the bitmap on the timage to another timage and
save it in a bitmap file. My problem is that, the bitmap I loaded
in the timage is a 8 bit bitmap. However, after I use CopyRect to
cut the useful part of the image to the new timage and saved it on
a file, it become a 24 bit bitmap. Can anyone tell me if there is
any easy method to save it as a 8 bit bitmap instead. Thanks in
advance.

Roy

 

Re:8 bit and 24 bit bitmap problem ....


Quote
>>>>> "Cheng" == Cheng Man Yuen <cs_...@ug.cs.ust.hk> writes:

 Cheng> Hi, I have written a program which loaded a bitmap to a timage
 Cheng> and then cut part of the bitmap on the timage to another
 Cheng> timage and save it in a bitmap file. My problem is that, the
 Cheng> bitmap I loaded in the timage is a 8 bit bitmap. However,
 Cheng> after I use CopyRect to cut the useful part of the image to
 Cheng> the new timage and saved it on a file, it become a 24 bit
 Cheng> bitmap. Can anyone tell me if there is any easy method to save
 Cheng> it as a 8 bit bitmap instead. Thanks in advance.

I'm not sure this is correct:
The 8 bit you load has a pallete, not? Try assigning this pallete to
the image component prior to calling copyRect.

This should make it 8 bit (But a nicer/more correct solution may exist).

Mads

--
+----------------------------------------------------------------------+
|  Mads Bondo Dydensborg.   Student at DIKU,  Copenhagen - Denmark.    |
|  Email: mads...@diku.dk   www: http://www.diku.dk/students/madsdyd/  |
+----------------------------------------------------------------------+

Other Threads