本文整理汇总了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;
}