回答編集履歴

1

DllImportAttribute → DllImport

2022/09/04 10:33

投稿

KOZ6.0
KOZ6.0

スコア2628

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
- [DllImportAttribute("gdi32.dll")]
10
+ [DllImport("gdi32.dll")]
11
11
  private static extern int RealizePalette(IntPtr hdc);
12
12
 
13
- using (var g = Graphics.FromImage(bitmap2)) {
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);