L
lianzhixin_2004
Unregistered / Unconfirmed
GUEST, unregistred user!
怎么实现一个图片的放大和缩小的显示,Image1里面显示的是原始的图,Image2里面可以显示放大或者缩小一定倍数的图
dCurScale := strtofloat(lb_city.Items.Strings[iCurIndex]);//比例
dWidth:=im1.Width*(1/dcurscale);//放大后的宽度
dHeight:=im1.Height*(1/dcurscale);//放大后的高度
CurScalerect.Left:=0;
CurScalerect.Right:=dwidth;
CurScalerect.top:=0;
CurScalerect.Bottom:=dheight;
im2.Canvas.StretchDraw(CurScalerect,im1.Picture.Bitmap);
这样显示的图是不完全的,如果我切割IM2里面的图像,里面的图片不是完全的,只有左上角的一部分区域。
dCurScale := strtofloat(lb_city.Items.Strings[iCurIndex]);//比例
dWidth:=im1.Width*(1/dcurscale);//放大后的宽度
dHeight:=im1.Height*(1/dcurscale);//放大后的高度
CurScalerect.Left:=0;
CurScalerect.Right:=dwidth;
CurScalerect.top:=0;
CurScalerect.Bottom:=dheight;
im2.Canvas.StretchDraw(CurScalerect,im1.Picture.Bitmap);
这样显示的图是不完全的,如果我切割IM2里面的图像,里面的图片不是完全的,只有左上角的一部分区域。