m.html
来自「windowsAPI介绍。很详细的」· HTML 代码 · 共 81 行
HTML
81 行
<!DOCTYPE html PUBLIC "-//Netscape Comm. Corp.//DTD HTML//EN">
<html>
<head>
<title>Windows 95 API Dictionary: M</title>
<base TARGET="_self">
<script LANGUAGE="JavaScript">
<!--Cloak
function statbar(txt) {
window.status = txt;
setTimeout("erase()",3000);
}
function erase() {
window.status = "";
}
//Decloak-->
</script>
</head>
<body BGCOLOR="#004000" TEXT="#FFFFFF" LINK="#FFFF00" VLINK="#FF8000" ALINK="#80FF80">
<p><a NAME="top"></a></p>
<h1 ALIGN="center">- M -</h1>
<hr ALIGN="center" WIDTH="85%" SIZE="5">
<p ALIGN="left"><a NAME="movetoex"></a></p>
<h3 ALIGN="center">MoveToEx Function</h3>
<code>
<p align="center">Declare Function MoveToEx Lib "gdi32.dll" (ByVal hdc As Long,
ByVal x As Long, ByVal y As Long, lpPoint As <a HREF="appa.html#pointapi">POINTAPI</a>) As
Long</code><br>
MoveToEx sets the current point of a graphical object. The current point is the starting
point from which graphics API calls ending with "To" begin drawing from. This is
the same general idea as being able to omit the first (x,y) pair in VB's Line method -- it
draws from the last point referenced. Also, any graphics API functions ending with
"To" almost always set the current point of the object to the last point drawn
to. MoveToEx also returns the former current point in <code>lpPoint</code>. You can safely
ignore the value returned.<br>
</p>
<table WIDTH="95%" BORDER="2" CELLSPACING="0">
<tr>
<td WIDTH="20%"><code>hdc</code></td>
<td WIDTH="80%">The device context of the control to reference. </td>
</tr>
<tr>
<td><code>x</code></td>
<td>The x coordinate of the point to set as the current point. </td>
</tr>
<tr>
<td><code>y</code></td>
<td>The y coordinate of the point to set as the current point. </td>
</tr>
<tr>
<td><code>lpPoint</code></td>
<td>Receives the coordinate of the former current point. </td>
</tr>
</table>
<b>
<p>Example:</b><br>
<code> 'Draw a line from (0,0) to (100,100) in Form1<br>
'The LineTo function starts from the current point, so we have to first<br>
'set the current point to (0,0). Notice how lpPoint can be ignored.<br>
Dim old As POINTAPI<br>
x = MoveToEx(Form1.hDC, 0, 0, old) 'set current point<br>
x = LineTo(Form1.hDC, 100, 100) 'draws from (0,0)</code><br>
<br>
<b>Category:</b> <a HREF="index.html#graphics" REL="Index">Graphics</a><br>
<a HREF="#top">返回到索引</a><a HREF="index.html" REL="Index">.</a> </p>
<hr ALIGN="center" WIDTH="85%" SIZE="5">
<p ALIGN="left"> </p>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?