参考如下代码:
#region Status
internal enum Status
{
Ok = 0,
GenericError = 1,
InvalidParameter = 2,
OutOfMemory = 3,
ObjectBusy = 4,
InsufficientBuffer = 5,
NotImplemented = 6,
Win32Error = 7,
WrongState = 8,
Aborted = 9,
FileNotFound = 10,
ValueOverflow = 11,
AccessDenied = 12,
UnknownImageFormat = 13,
FontFamilyNotFound = 14,
FontStyleNotFound = 15,
NotTrueTypeFont = 16,
UnsupportedGdiplusVersion = 17,
GdiplusNotInitialized = 18,
PropertyNotFound = 19,
PropertyNotSupported = 20,
ProfileNotFound = 21
}
#endregion[StructLayout(LayoutKind.Sequential)]
internal struct GdiplusStartupInput
{
uint GdiplusVersion;
IntPtr DebugEventCallback;
int SuppressBackgroundThread;
int SuppressExternalCodecs; internal static GdiplusStartupInput MakeGdiplusStartupInput()
{
GdiplusStartupInput result = new GdiplusStartupInput();
result.GdiplusVersion = 1;
result.DebugEventCallback = IntPtr.Zero;
result.SuppressBackgroundThread = 0;
result.SuppressExternalCodecs = 0;
return result;
}
}[StructLayout(LayoutKind.Sequential)]
internal struct GdiplusStartupOutput
{
internal IntPtr NotificationHook;
internal IntPtr NotificationUnhook; internal static GdiplusStartupOutput MakeGdiplusStartupOutput()
{
GdiplusStartupOutput result = new GdiplusStartupOutput();
result.NotificationHook = result.NotificationUnhook = IntPtr.Zero;
return result;
}
}[DllImport("gdiplus.dll")]
static internal extern Status GdiplusStartup(ref ulong token,
ref GdiplusStartupInput input, ref GdiplusStartupOutput output);
#region Status
internal enum Status
{
Ok = 0,
GenericError = 1,
InvalidParameter = 2,
OutOfMemory = 3,
ObjectBusy = 4,
InsufficientBuffer = 5,
NotImplemented = 6,
Win32Error = 7,
WrongState = 8,
Aborted = 9,
FileNotFound = 10,
ValueOverflow = 11,
AccessDenied = 12,
UnknownImageFormat = 13,
FontFamilyNotFound = 14,
FontStyleNotFound = 15,
NotTrueTypeFont = 16,
UnsupportedGdiplusVersion = 17,
GdiplusNotInitialized = 18,
PropertyNotFound = 19,
PropertyNotSupported = 20,
ProfileNotFound = 21
}
#endregion[StructLayout(LayoutKind.Sequential)]
internal struct GdiplusStartupInput
{
uint GdiplusVersion;
IntPtr DebugEventCallback;
int SuppressBackgroundThread;
int SuppressExternalCodecs; internal static GdiplusStartupInput MakeGdiplusStartupInput()
{
GdiplusStartupInput result = new GdiplusStartupInput();
result.GdiplusVersion = 1;
result.DebugEventCallback = IntPtr.Zero;
result.SuppressBackgroundThread = 0;
result.SuppressExternalCodecs = 0;
return result;
}
}[StructLayout(LayoutKind.Sequential)]
internal struct GdiplusStartupOutput
{
internal IntPtr NotificationHook;
internal IntPtr NotificationUnhook; internal static GdiplusStartupOutput MakeGdiplusStartupOutput()
{
GdiplusStartupOutput result = new GdiplusStartupOutput();
result.NotificationHook = result.NotificationUnhook = IntPtr.Zero;
return result;
}
}[DllImport("gdiplus.dll")]
static internal extern Status GdiplusStartup(ref ulong token,
ref GdiplusStartupInput input, ref GdiplusStartupOutput output);
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货