图片的放大和缩小问题
//放大if MImageBoolean = true then
begin
SetStretchBltMode(ImagePaint.Canvas.Handle,STRETCH_DELETESCANS);//防止图片严重损失
StretchBlt(ImagePaint.Canvas.Handle, ImagePaint.Left, ImagePaint.Top, ImagePaint.Width * 2, ImagePaint.Height * 2, ImagePaint.Canvas.Handle, ImagePaint.Left, ImagePaint.Top, ImagePaint.Width , ImagePaint.Height, SRCCOPY);
ImagePaint.Refresh;
end
else
begin
//还原图片大小
SetStretchBltMode(ImagePaint.Canvas.Handle,STRETCH_DELETESCANS);//防止图片严重损失
StretchBlt(ImagePaint.Canvas.Handle, ImagePaint.Left, ImagePaint.Top, ImagePaint.Width, ImagePaint.Height, ImagePaint.Canvas.Handle, ImagePaint.Left, ImagePaint.Top, ImagePaint.Width * 2, ImagePaint.Height* 2, SRCCOPY);
ImagePaint.Refresh;
ImagePaint.Repaint;
end;
MImageBoolean := not MImageBoolean;
按照这样写的话,当图片放大后,再把它缩小时,在画布上会显示放大的图片和缩小的图片(本来应该只显示缩小后的图片,结果放大后的那张图片也在画布上)。请教,该怎么处理?