[译]ViewPort资源管理器
By robot-v1.0
本文链接 https://www.kyfws.com/applications/the-viewport-explorer-zh/
版权声明 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
- 2 分钟阅读 - 849 个词 阅读量 0[译]ViewPort资源管理器
原文地址:https://www.codeproject.com/Articles/10952/The-ViewPort-Explorer
原文作者:Joseph M. Newcomer
译文由本站 robot-v1.0 翻译
前言
A viewport explorer utility.
视口浏览器实用程序.
介绍(Introduction)
这个小项目之所以出现,是因为我发现我认为映射方式描述中存在错误.作者坚持认为描述是正确的,因此为了证明它是错误的,我编写了一个小程序来演示正在发生的事情.结果证明我是正确的.(This little project came about because I found what I thought was an error in a description of mapping modes. The author insisted the description was correct, so to prove that it was wrong, I wrote a little program that demonstrated what was going on. The result demonstrated that I was correct.)
但是,该程序似乎非常有用,因此我对其进行了增强.它具有各种有趣的功能,这些功能可能超出其演示能力而已(However, the program seemed quite useful, so I enhanced it. It has all sorts of interesting features that might be useful beyond its ability to demonstrate) SetWindowOrg
,(,) SetWindowExt
,(,) SetViewportOrg
和(and) SetViewportExt
.(.)
应用程序对话框如下所示.它允许设置四个缩放API的参数以及用于选择映射模式的选项.(The application dialog is shown below. It allows setting the parameters for the four scaling APIs, and options for selecting the mapping mode.)
因为更改模式可以使轴指示器移出屏幕,所以"圆圈"选项提供了"查找器"功能(类似于在示波器上找到的功能),因此可以在图像周围拖动.(Because changing modes can make the axis indicators move off-screen, the “circles” option provides a “finder” capability (like that found on oscilloscopes) so you can drag the image around.)
这演示了映射模式的使用和逻辑坐标的使用.它还实现(This demonstrates the use of mapping modes and the use of logical coordinates. It also implements) DPtoLP
和(and) LPtoDP
.在图片中,请注意(. In the picture, note that) MM_ANISOTROPIC
被选中,并且窗口范围的两个值均为负,因此反转了法线轴,其中x向左增大,y向上增大.(was selected, and both the values for the window extent are negative, thus reversing the normal axis, with x increasing to the left and y increasing upwards.)
其他可爱的功能包括带有箭头的所有者绘制按钮,鼠标捕获和拖动,在拖动操作期间处理CTRL键以及一些可爱的图形计算功能.(Other cute features include the owner-draw buttons with arrows, mouse capture and dragging, handling the CTRL key during a drag operation, and some cute graphical computation functions.)
许可
本文以及所有相关的源代码和文件均已获得The Code Project Open License (CPOL)的许可。
C++ VC6 Windows Visual-Studio Dev 新闻 翻译