本文整理匯總了C#中Standard.SafeDC類的典型用法代碼示例。如果您正苦於以下問題:C# SafeDC類的具體用法?C# SafeDC怎麽用?C# SafeDC使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
SafeDC類屬於Standard命名空間,在下文中一共展示了SafeDC類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: UpdateLayeredWindow
public static void UpdateLayeredWindow(
IntPtr hwnd,
SafeDC hdcDst,
ref POINT pptDst,
ref SIZE psize,
SafeDC hdcSrc,
ref POINT pptSrc,
int crKey,
ref BLENDFUNCTION pblend,
ULW dwFlags)
{
if (!_UpdateLayeredWindow(hwnd, hdcDst, ref pptDst, ref psize, hdcSrc, ref pptSrc, crKey, ref pblend, dwFlags))
{
HRESULT.ThrowLastError();
}
}
示例2: SelectObject
public static IntPtr SelectObject(SafeDC hdc, SafeHBITMAP hgdiobj)
{
IntPtr ret = _SelectObjectSafeHBITMAP(hdc, hgdiobj);
if (ret == IntPtr.Zero)
{
HRESULT.ThrowLastError();
}
return ret;
}
示例3: _UpdateLayeredWindow
private static extern bool _UpdateLayeredWindow(
IntPtr hwnd,
SafeDC hdcDst,
[In] ref POINT pptDst,
[In] ref SIZE psize,
SafeDC hdcSrc,
[In] ref POINT pptSrc,
int crKey,
ref BLENDFUNCTION pblend,
ULW dwFlags);
示例4: _SelectObject
private static extern IntPtr _SelectObject(SafeDC hdc, IntPtr hgdiobj);
示例5: _SelectObjectSafeHBITMAP
private static extern IntPtr _SelectObjectSafeHBITMAP(SafeDC hdc, SafeHBITMAP hgdiobj);
示例6: GetDeviceCaps
public static extern int GetDeviceCaps(SafeDC hdc, DeviceCap nIndex);
示例7: CreateDIBSection
public static SafeHBITMAP CreateDIBSection(SafeDC hdc, ref BITMAPINFO bitmapInfo, out IntPtr ppvBits, IntPtr hSection, int dwOffset)
{
const int DIB_RGB_COLORS = 0;
SafeHBITMAP hBitmap = null;
if (hdc == null)
{
hBitmap = _CreateDIBSectionIntPtr(IntPtr.Zero, ref bitmapInfo, DIB_RGB_COLORS, out ppvBits, hSection, dwOffset);
}
else
{
hBitmap = _CreateDIBSection(hdc, ref bitmapInfo, DIB_RGB_COLORS, out ppvBits, hSection, dwOffset);
}
if (hBitmap.IsInvalid)
{
HRESULT.ThrowLastError();
}
return hBitmap;
}
示例8: _CreateDIBSection
private static extern SafeHBITMAP _CreateDIBSection(SafeDC hdc, [In] ref BITMAPINFO bitmapInfo, int iUsage, [Out] out IntPtr ppvBits, IntPtr hSection, int dwOffset);
示例9: CreateCompatibleDC
public static SafeDC CreateCompatibleDC(SafeDC hdc)
{
SafeDC dc = null;
try
{
IntPtr hPtr = IntPtr.Zero;
if (hdc != null)
{
hPtr = hdc.handle;
}
dc = NativeMethods.CreateCompatibleDC(hPtr);
if (dc == null)
{
HRESULT.ThrowLastError();
}
}
finally
{
if (dc != null)
{
dc._created = true;
}
}
if (dc.IsInvalid)
{
dc.Dispose();
throw new SystemException("Unable to create a device context from the specified device information.");
}
return dc;
}
示例10: SelectObject
public static IntPtr SelectObject(SafeDC hdc, IntPtr hgdiobj)
{
var ret = _SelectObject(hdc, hgdiobj);
if (ret == IntPtr.Zero)
{
HRESULT.ThrowLastError();
}
return ret;
}