From: Matthijs W. <mat...@wi...> - 2011-10-24 15:39:32
|
Hi, If this code is copy pasted from your original code, then there is a type in it. You have > 1, < 10 and = 1. So if aspect is between 1 and 10 nothing happens. Regards, Matthijs From: Lawrence Schlachter Sent: Sunday, October 23, 2011 8:14 PM To: laz...@li... Subject: [Lazarus-ccr-general] Question Thanking any responders before hand. How does one use picture aspect in changing the appearance of photos. The following code which works in Delphi doesn't work in Lazarus: Var aspect: real; h,w : integer; rec: TRect; OpenPictureDialog1.execute; image1.picture.loadfromfile(OpenPictureDialog1.filename); aspect := image1.width/image1.height; if aspect < 1.0 then begin h := image1.height; w:= round(aspect*h); end else if apsect > 10.0 then begin w := image1.width; h := round(w/aspect); end else if aspect = 1.0 then begin h:= image1.height; w := image1.width; end; rec := Rect(0,0,w,h); image1.canvas.stretchdraw(rec,image1.picture,graphic); Any comments???? Thanks LSchlachter -------------------------------------------------------------------------------- ------------------------------------------------------------------------------ The demand for IT networking professionals continues to grow, and the demand for specialized networking skills is growing even more rapidly. Take a complimentary Learning@Cisco Self-Assessment and learn about Cisco certifications, training, and career opportunities. http://p.sf.net/sfu/cisco-dev2dev -------------------------------------------------------------------------------- _______________________________________________ Lazarus-ccr-general mailing list Laz...@li... https://lists.sourceforge.net/lists/listinfo/lazarus-ccr-general |