本文整理汇总了C#中System.Windows.Forms.RECT.ToRectangle方法的典型用法代码示例。如果您正苦于以下问题:C# RECT.ToRectangle方法的具体用法?C# RECT.ToRectangle怎么用?C# RECT.ToRectangle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.RECT
的用法示例。
在下文中一共展示了RECT.ToRectangle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PaintEventStart
internal override PaintEventArgs PaintEventStart(ref Message msg, IntPtr handle, bool client) {
IntPtr hdc;
PAINTSTRUCT ps;
PaintEventArgs paint_event;
RECT rect;
Rectangle clip_rect;
Hwnd hwnd;
clip_rect = new Rectangle();
rect = new RECT();
ps = new PAINTSTRUCT();
hwnd = Hwnd.ObjectFromHandle(msg.HWnd);
if (client) {
if (Win32GetUpdateRect(msg.HWnd, ref rect, false)) {
if (handle != msg.HWnd) {
// We need to validate the window where the paint message
// was generated, otherwise we'll never stop getting paint
// messages.
Win32GetClientRect (msg.HWnd, out rect);
Win32ValidateRect (msg.HWnd, ref rect);
hdc = Win32GetDC (handle);
} else {
hdc = Win32BeginPaint (handle, ref ps);
rect = ps.rcPaint;
}
} else {
hdc = Win32GetDC(handle);
}
clip_rect = rect.ToRectangle ();
} else {
hdc = Win32GetWindowDC (handle);
// HACK this in for now
Win32GetWindowRect (handle, out rect);
clip_rect = new Rectangle (0, 0, rect.Width, rect.Height);
}
// If we called BeginPaint, store the PAINTSTRUCT,
// otherwise store hdc, so that PaintEventEnd can know
// whether to call EndPaint or ReleaseDC.
if (ps.hdc != IntPtr.Zero) {
hwnd.drawing_stack.Push (ps);
} else {
hwnd.drawing_stack.Push (hdc);
}
Graphics dc = Graphics.FromHdc(hdc);
hwnd.drawing_stack.Push (dc);
paint_event = new PaintEventArgs(dc, clip_rect);
return paint_event;
}
示例2: ToRectangle
public static global::System.Drawing.Rectangle ToRectangle(RECT Rectangle)
{
return Rectangle.ToRectangle();
}