关于图形的放大、缩小问题(200分)

  • 主题发起人 主题发起人 JinBo
  • 开始时间 开始时间
To Jinbo, 原因是没有恢复映像模式,应该这样做:<br>var<br>&nbsp; OldWindowExtent, OldViewPortExtent: TSize;<br>&nbsp; OldMapMode: Integer;<br>begin<br>&nbsp; &nbsp; OldMapMode := SetMapMode(Handle, MM_ANISOTROPIC);<br>&nbsp; &nbsp; SetWindowExtEx(Handle,100,100,@OldWindowExtent);<br>&nbsp; &nbsp; SetViewPortExtEx(Handle, NewZoom, NewZoom, @OldViewPortExtent);<br>&nbsp; &nbsp; // 执行自定义绘画过程<br>&nbsp; &nbsp; ...<br>&nbsp; &nbsp; // 恢复映像模式<br>&nbsp; &nbsp; SetViewPortExtEx(Handle,OldViewPortExtent.cx,OldViewPortExtent.cy,nil);<br>&nbsp; &nbsp; SetWindowExtEx(Handle,OldWindowExtent.cx,OldWindowExtent.cy,nil);<br>&nbsp; &nbsp; SetMapMode(Handle, OldMapMode);<br>end;<br><br>See it ?<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;From: BaKuBaKu
 
多人接受答案了。
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
591
import
I
D
回复
0
查看
2K
DelphiTeacher的专栏
D
后退
顶部