From: Lawrence S. <LS...@at...> - 2011-10-23 18:14:09
|
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 |