メモ帳

備忘録

Graphics.DrawImageがドットバイドットで書き込まれない

以下のサイトのように、書き込み元と書き込み先のBitmapの解像度を揃えたら解決した。

Resolved! the dafault DPI value of the System.Drawing.Bitmap is = 96, if I open an image with DPI != 96 then the problem described above occurs. To get rid of it, I needed to use SetResolution method:

Bitmap result = new Bitmap(width, height);
result.SetResolution(OriginalIMG.HorizontalResolution, OriginalIMG.VerticalResolution);

that resolves the problem :) Thanks for everyone for help ! :)

http://stackoverflow.com/questions/2681813/c-sharp-winforms-graphics-drawimage-problem