Dunno about the pngs. Feel free to send him my way directly if he has more questions... C.
________________________________ From: delphi-boun...@delphi.org.nz [mailto:delphi-boun...@delphi.org.nz] On Behalf Of Robert martin Sent: Tuesday, 13 October 2009 4:41 p.m. To: NZ Borland Developers Group - Delphi List Subject: Re: [DUG] Image manipulation Nice ! I had read that since GraphicsEx loads images as bitmaps you lost some of the advanced features of the image format. Do you know if png files retain their transparencies? This all looks very promising. I will forward this on to the man doing the work :) Rob Conor Boyd wrote: Yeah, those issues are what drove my choice of Graphics32 (image quality and scaling). Here's some code which uses Graphics32 to resample an image. OldBitmap, TempBitmap are of type Graphics32.TBitmap32 NewBitmap is of type Graphics.TBitmap; OldBitmap.Assign(a regular Graphics.TBitmap here which you could load using GraphicEx); TempBitmap := TBitmap32.Create; try TempBitmap.Width := Trunc(OldBitmap.Width * Scale); TempBitmap.Height := Trunc(OldBitmap.Height * Scale); rs := TKernelResampler.Create(OldBitmap); if FastResamplingWanted then rs.Kernel := THermiteKernel.Create else rs.Kernel := TLanczosKernel.Create; GR32_Resamplers.StretchTransfer(TempBitmap, Rect(0, 0, TempBitmap.Width, TempBitmap.Height), Rect(0, 0, TempBitmap.Width, TempBitmap.Height), OldBitmap, Rect(0, 0, OldBitmap.Width, OldBitmap.Height), rs, dmBlend, Nil); NewBitmap.Assign(TempBitmap); finally TempBitmap.Free; end; I've paraphrased this from some code of mine, but hopefully that's the gist of a high-quality resample for you using Graphics32. Cheers, Conor [snip]
_______________________________________________ NZ Borland Developers Group - Delphi mailing list Post: delphi@delphi.org.nz Admin: http://delphi.org.nz/mailman/listinfo/delphi Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: unsubscribe