:
Bitmap bm = new Bitmap(iWidth, iHeight);
using (Graphics graphics = Graphics.FromImage(bm))
{
graphics.CompositingMode = System.Drawing.Drawing2D.CompositingMode.SourceCopy;
graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
graphics.DrawImage(bmOriginal, 0, 0, iWidth, iHeight);
}
나는 글꼴이 방법을 사용했다. .Net은 일반적으로 96 DPI 인 시스템 해상도를 사용하지만 프린터는 300 DPI 이상의 파일을 처리 할 수 있습니다.
'Create a new bitmap
Using Bmp As New Bitmap(800, 1000, Imaging.PixelFormat.Format32bppPArgb)
'Set the resolution to 300 DPI
Bmp.SetResolution(300, 300)
'Create a graphics object from the bitmap
Using G = Graphics.FromImage(Bmp)
'Paint the canvas white
G.Clear(Color.White)
'Set various modes to higher quality
G.InterpolationMode = Drawing2D.InterpolationMode.HighQualityBicubic
G.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias
G.TextRenderingHint = Drawing.Text.TextRenderingHint.AntiAlias
'Create a font
Using F As New Font("Arial", 12)
'Create a brush
Using B As New SolidBrush(Color.Black)
'Draw some text
G.DrawString("Hello world", F, B, 20, 20)
End Using
End Using
End Using
'Save the file as a TIFF
Bmp.Save("c:\test.tiff", Imaging.ImageFormat.Tiff)
End Using
비트 맵 (bmp)과 동일한 문제가 있습니까? –
예, BMP, TIFF, JPG 등 어떤 유형을 만들어도 품질이 악화됩니다. – ajl