[lazarus] TImage

Mattias Gaertner nc-gaertnma at netcologne.de
Mon Mar 12 06:05:42 EST 2001


On 2001.03.12 09:09:43 +0100 FoodTechnologist wrote:
> I don't think that it is needed. *.xpm structure is quite simple, but...
> It is not efficient for 16-24bpp.
> By the way, bitmap and pixmap are not compartible if there are 16-24bpp.
> bitmap in that case contain no pallete. Pixmap do.

You are right. xpm is only an icon format. I misunderstood the xpm
description: "xpm is a powerful format" - lol.


> So, we must find all colors in image,
> make temporary array of color and pseudoname of it (so much memory) and
> then write xpm.

My idea is to create a copy of the bitmap, sort the pixels, count the
colors and build the color table for the xpm, finally build the xpm pixel
data.


> Besides, I've found a bug in your code: ReadSize for Bits is compared
> with InfoSize - the size of Info (line 214 of bitmap.inc of 07.03.01). It
must be
> compared with ImgSize.

fixed.


Mattias










More information about the Lazarus mailing list