本文整理汇总了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();
}
}
开发者ID:JianwenSun,项目名称:cc,代码行数:16,代码来源:NativeMethods.cs
示例2: SelectObject
public static IntPtr SelectObject(SafeDC hdc, SafeHBITMAP hgdiobj)
{
IntPtr ret = _SelectObjectSafeHBITMAP(hdc, hgdiobj);
if (ret == IntPtr.Zero)
{
HRESULT.ThrowLastError();
}
return ret;
}
开发者ID:JianwenSun,项目名称:cc,代码行数:9,代码来源:NativeMethods.cs
示例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);
开发者ID:JianwenSun,项目名称:cc,代码行数:10,代码来源:NativeMethods.cs
示例4: _SelectObject
private static extern IntPtr _SelectObject(SafeDC hdc, IntPtr hgdiobj);
开发者ID:JianwenSun,项目名称:cc,代码行数:1,代码来源:NativeMethods.cs
示例5: _SelectObjectSafeHBITMAP
private static extern IntPtr _SelectObjectSafeHBITMAP(SafeDC hdc, SafeHBITMAP hgdiobj);
开发者ID:JianwenSun,项目名称:cc,代码行数:1,代码来源:NativeMethods.cs
示例6: GetDeviceCaps
public static extern int GetDeviceCaps(SafeDC hdc, DeviceCap nIndex);
开发者ID:JianwenSun,项目名称:cc,代码行数:1,代码来源:NativeMethods.cs
示例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;
}
开发者ID:JianwenSun,项目名称:cc,代码行数:20,代码来源:NativeMethods.cs
示例8: _CreateDIBSection
private static extern SafeHBITMAP _CreateDIBSection(SafeDC hdc, [In] ref BITMAPINFO bitmapInfo, int iUsage, [Out] out IntPtr ppvBits, IntPtr hSection, int dwOffset);
开发者ID:JianwenSun,项目名称:cc,代码行数:1,代码来源:NativeMethods.cs
示例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;
}
开发者ID:JianwenSun,项目名称:cc,代码行数:32,代码来源:NativeMethods.cs
示例10: SelectObject
public static IntPtr SelectObject(SafeDC hdc, IntPtr hgdiobj)
{
var ret = _SelectObject(hdc, hgdiobj);
if (ret == IntPtr.Zero)
{
HRESULT.ThrowLastError();
}
return ret;
}
开发者ID:x-skywalker,项目名称:CodeMask,代码行数:9,代码来源:NativeMethods.cs
注:本文中的Standard.SafeDC类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论