From: Ignacio Alvarez Subject: Re: Generation of 24-bit colour memory-bitmap with computer running lower colour-depth Date: 12 Apr 1999 00:00:00 GMT Message-ID: <3712E94A.E15F286F@son1.telmex.net.mx> Content-Transfer-Encoding: 7bit References: <7d5grs$ijg2@forums.borland.com> To: Thomas Munk X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Newsgroups: borland.public.delphi.graphics I've encountered the same problems, and found a solution. When you're in 256 color mode, and you resize a TBitmap, a palette is always created (even if PixelFormat = pf24Bit). So when you save a modified 24Bit bitmap to disk, the unnecessary palette is saved too. Apparently, Delphi can read this corrupt bitmap, but other programs that expect a standard bitmap, display it all wrong. The solution is to set the Palette to 0 before saving it (i.e. Bitmap.Palette:= 0). Thomas Munk wrote: > Hello Delphi-group > > I was wondering if someone could give me some guidelines for handling the > following job in Delphi 3: > > I want my program to generate one bitmap containing several thumbnails of > other bitmaps. This final thumb-bitmap should be 24-bit colours, no matter > what colour-depth the computer runs at generation time. The bitmaps to be > thumbnailed are both 24-bit and other depths. What I do today is this: > > - B:=TBitmap.Create > - B.PixelFormat:=pf24bit; > - Set B.Width and B.Height to 500 x 480 > - Putting in the small thumbnails with B.Canvas.Draw > - Maybe assigning B.Width and/or B.Height smaller values > - B.SaveToFile > > I works allright most of the time, but here's my problem: If the computer > runs less than 24-bit colour-depth and I assign smaller values to the > bitmap's width and height the saved image goes crazy. With 'crazy' I mean > wrong (blue-like) colours and image pushed half left or right. If I don't > touch the width/height all seems right OR if the computer runs at 24-bit > depth it's allright to adjust the width/height. > > Am I doing this the complete wrong way? > > Thomas