0
我已經搜索了很多,使用幾乎所有的優選的方法,但我還沒有得到具有高品質的位圖圖像的結果:以下是我已經使用的代碼:爲什麼創建的bmp圖像沒有得到高質量?
ean13.Scale = 0.8f;
ean13.Scale = (float)Convert.ToDecimal(cboScale.Items[cboScale.SelectedIndex]);// it includes the sizes
Bitmap bmp = ean13.CreateBitmap();
Graphics g = Graphics.FromImage(bmp);
g.DrawString(tcc.Text, this.Font, Brushes.Black, 120, 80);// title
g.DrawString(bcc.Text, this.Font, Brushes.Black, 120, 1); //the price
g.SmoothingMode = SmoothingMode.AntiAlias;
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit;
g.TextRenderingHint = TextRenderingHint.SingleBitPerPixelGridFit;
g.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
g.PixelOffsetMode = PixelOffsetMode.HighQuality;
g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit;
g.TextRenderingHint = TextRenderingHint.SingleBitPerPixelGridFit;
g.Flush();
this.picbox.Image = bmp;
你能發佈一個預期結果與實際結果的例子嗎? 「高質量」是非常主觀的。 – user1440308
感謝downvote,你可以溫柔地問,所以我可以按照你的想法 –
儘量不要使用cleartype。 你也琢磨兩遍。 – CSharpie