-
August 29th, 2012, 11:37 AM
#1
Improving quality of image
Hello,
I have an image that I would like to make more "crisp".
The code (in C#) for producing the image looks like this:
Code:
Bitmap bitmap = new Bitmap(rectangle.Width, rectangle.Height, PixelFormat.Format24bppRgb);
Graphics graphics = Graphics.FromImage(bitmap);
graphics.Clear(Color.White);
BowTieController controller = new BowTieController(_session, loop, new PointF(1.0F, 1.0F));
controller.Draw(graphics, rectangle);
What a BowTieController is may or may not be important right now, but I'd like to focus first on how the Bitmap and Graphics objects are initialized, and if the problem turns out not to be there, we can then focus on the BowTieController and how it draws the image.
First, let me explain where the problem shows up. After the above code draws the image, it is then placed into a Picture control in ActiveReports. It is then exported to PDF. You really notice the poor quality of the image in PDF. Something like the resolution or anti-aliasing needs to be improved.
I tried things like the following to no avail:
bitmap.SetResolution(bitmap.HorizontalResolution * 2, bitmap.VerticalResolution * 2);
graphics.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
Is there anything else I can try on the Bitmap or Graphics objects that might make the image appear more "crip"?
-
August 29th, 2012, 08:32 PM
#2
Re: Improving quality of image
Can you source the image in vector format? First question/best solution for export to PDF.
-
August 31st, 2012, 09:55 AM
#3
Re: Improving quality of image
No, but we solved half the problem by doing this:
PdfExport.ImageQuality = ImageQuality.Highest;
-
September 22nd, 2012, 04:28 PM
#4
Re: Improving quality of image
Have you tried setting graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic?
-
September 23rd, 2012, 04:26 AM
#5
Re: Improving quality of image
PDF has a mode for "lossless image compression", using, I think, ZIP compression. You might want to try that mode...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|