⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xy.txt

📁 自动化控制visio
💻 TXT
字号:
/// <param name="referenceWindow">Reference to a Visio window</param>
/// <param name="drawingX">X position in the Visio coordinate system
/// </param>
/// <param name="drawingY">Y position in the Visio coordinate system
/// </param>
/// <returns>Point containing the given Visio coordinate in Windows
/// coordinates</returns>
public static System.Drawing.Point MapDrawingToScreen(
Microsoft.Office.Interop.Visio.Window referenceWindow,
double drawingX,
double drawingY) {

double drawingLeft;
double drawingTop;
double drawingWidth;
double drawingHeight;
int screenLeft;
int screenTop;
int screenWidth;
int screenHeight;
int screenX = 0;
int screenY = 0;

try {

// Get the window coordinates in Visio units.
referenceWindow.GetViewRect(out drawingLeft, out drawingTop,
out drawingWidth, out drawingHeight);

// Get the window coordinates in pixels.
referenceWindow.GetWindowRect(out screenLeft, out screenTop,
out screenWidth, out screenHeight);

// Convert the X coordinate by using pixels per inch from the
// width values.
screenX = (int)Math.Round(screenLeft +
((screenWidth / drawingWidth) * (drawingX - drawingLeft)));

// Convert the Y coordinate by using pixels per inch from the
// height values and using a top-left origin (windows
// coordinates) instead of a bottom-left origin (Visio
// coordinates).
screenY = (int)(screenTop +
((screenHeight / drawingHeight) * (drawingTop - drawingY)));
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -