Thanks for sharing. ________________________________
From: [email protected] [mailto:[email protected]] On Behalf Of Kyley Harris Sent: Tuesday, 19 January 2010 10:58 a.m. To: NZ Borland Developers Group - Delphi List Subject: Re: [DUG] Resizing images begin FSourceBMP.Assign(Value); if Zoom <> 1 then begin FBMP.Assign(FSourceBMP); FBMP.Width := Trunc(FSourceBMP.Width * Zoom); FBMP.Height := Trunc(FSourceBMP.Height * Zoom); Stretch(FBMP.Width, FBMP.Height ,sfBox,1,FSourceBMP,FBMP); end else FBMP.Assign(FSourceBMP); FImageAssigned := True; end; here is a snippet using a Zoom variable to stretch with Aspect ratio. Its basically the same as TCanvas.stretch, but faster and far higher quality. There are a few options (sfBox, Triangle) etc for how it samples the pixels.. different ones get better results for Text, photo.. etc.. On Tue, Jan 19, 2010 at 10:53 AM, Kyley Harris <[email protected]> wrote: Sure.. gimme 5 minutes i can email you the source too.. its open On Tue, Jan 19, 2010 at 10:31 AM, Conor Boyd <[email protected]> wrote: Can you post your example? Or another example? C. ________________________________ From: [email protected] [mailto:[email protected]] On Behalf Of John Bird Sent: Tuesday, 19 January 2010 9:46 a.m. To: NZ Borland Developers Group - Delphi List Subject: [DUG] Resizing images Resizing images for Images, bitButtons and icons - I guess we all do this. I have used IrfanView and Photofiltre for resizing images, and noticed they tend to alter the edge pixels around an image - I guess it averages the pixel colours on a sharp edge if resizing smaller. This is a problem with images with a background surround - these pixels are not the transparent background colour any more and create a ragged edge noticeable when the image is on a darker background. How do others resize images properly? (Example is the Analogue clock with the image background some are using- over a dark background you may see there are a fewer light pixels around the edge that shouldn't be there) John _______________________________________________ NZ Borland Developers Group - Delphi mailing list Post: [email protected] Admin: http://delphi.org.nz/mailman/listinfo/delphi Unsubscribe: send an email to [email protected] with Subject: unsubscribe -- Kyley Harris Harris Software +64-21-671-821 -- Kyley Harris Harris Software +64-21-671-821
_______________________________________________ NZ Borland Developers Group - Delphi mailing list Post: [email protected] Admin: http://delphi.org.nz/mailman/listinfo/delphi Unsubscribe: send an email to [email protected] with Subject: unsubscribe
