谁能帮我解释这段程序(100分)

  • 主题发起人 主题发起人 micony
  • 开始时间 开始时间
M

micony

Unregistered / Unconfirmed
GUEST, unregistred user!
&nbsp; 谁能给我解释这段程序,谢了<br>&nbsp; &nbsp;beginpath(canvas.handle);<br>&nbsp; &nbsp;setBKMode(canvas.handle,TRANSPENT);<br>&nbsp; &nbsp;canvas.font.size.:=100;<br>&nbsp; &nbsp;canvas.textout(20,20,'大富翁论坛');<br>&nbsp; <br>&nbsp; &nbsp;endpath(canvas.handle);<br>&nbsp; &nbsp;setWindowRgn(handle,pathToRegion(canvas.handle,true);<br>&nbsp; &nbsp;我主要是不明白beginpath,setBKMode,endpath这三个函数,哪位大虾能指点一二?<br>&nbsp; 谢了。
 
beginpath(canvas.handle)表示此后在canvas.handle上的画图操作均转换为path,直到<br>endpath执行<br>setBKMode是设置Textout的背景色。
 
beginpath:<br>BOOL BeginPath(<br>&nbsp; &nbsp; HDC hdc // handle to device context <br>&nbsp; &nbsp;); <br>Parameters<br>hdc<br>Identifies the device context.<br>When constructing a path, only the CloseFigure, ExtTextOut, <br>LineTo, MoveToEx, PolyBezier, PolyBezierTo, Polygon, Polyline, PolylineTo, <br>PolyPolygon, PolyPolyline, and TextOut functions are recorded.<br><br>setBKMode:<br>The SetBkMode function sets the background mix mode of the specified device <br>context. The background mix mode is used with text, hatched brushes, and pen <br>styles that are not solid lines. <br>int SetBkMode(<br>&nbsp; &nbsp; HDC hdc, // handle of device context<br>&nbsp; &nbsp; int iBkMode // flag specifying background mode<br>&nbsp; &nbsp;); <br>Parameters<br>hdc<br>Identifies the device context. <br>iBkMode<br>Specifies the background mode. This parameter can be either of the following values: <br>Value Description<br>OPAQUE Background is filled with the current background color before the text, hatched brush, or pen is drawn.<br>TRANSPARENT Background remains untouched.<br>Return Values<br>If the function succeeds, the return value specifies the previous background mode.<br>If the function fails, the return value is zero. <br>Remarks<br>The SetBkMode function affects the line styles for lines drawn using a pen created by the CreatePen function. SetBkMode does not affect lines drawn using a pen created by the ExtCreatePen function. <br>The iBkMode parameter can also be set to driver-specific values. GDI passes such values to the device driver and otherwise ignores them.<br><br>endpath:<br>he EndPath function closes a path bracket and selects the path defined by the bracket into the specified device context. <br>BOOL EndPath(<br>&nbsp; &nbsp; HDC hdc // handle to device context <br>&nbsp; &nbsp;); <br>Parameters<br>hdc<br>Identifies the device context into which the new path is selected. <br>Return Values<br>If the function succeeds, the return value is nonzero.<br>If the function fails, the return value is zero. To get extended error <br>information, call GetLastError. GetLastError may return one of the following error codes: <br>ERROR_CAN_NOT_COMPLETE<br>ERROR_INVALID_PARAMETER
 
zhhc,能否说得在详细点,那path有是什么东西呢?还有TRANSPENT有是什么意思呢?<br>
 
自己看帮助吧,帮助很详细的<br>
 
path是一个矢量图。TRANSPENT表示背景是透明的。
 
你功底还不扎实,继续努力吧!
 
TO 小聪,呵呵,功底不够,正需要大家帮忙嘛 &nbsp; *^_^*
 
多人接受答案了。
 
后退
顶部