回答編集履歴
1
DllImportAttribute → DllImport
test
CHANGED
@@ -7,10 +7,10 @@
|
|
7
7
|
[DllImport("gdi32.dll")]
|
8
8
|
private static extern IntPtr SelectPalette(IntPtr hdc, IntPtr hpal, bool bForceBackground);
|
9
9
|
|
10
|
-
[DllImport
|
10
|
+
[DllImport("gdi32.dll")]
|
11
11
|
private static extern int RealizePalette(IntPtr hdc);
|
12
12
|
|
13
|
-
using (var g = Graphics.FromImage(bitmap
|
13
|
+
using (var g = Graphics.FromImage(bitmap)) {
|
14
14
|
IntPtr hdc = g.GetHdc();
|
15
15
|
IntPtr oldPal = SelectPalette(hdc, Graphics.GetHalftonePalette(), true);
|
16
16
|
RealizePalette(hdc);
|