August 29th, 2012, 11:37 AM
Improving quality of image
I have an image that I would like to make more "crisp".
The code (in C#) for producing the image looks like this:
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.
Bitmap bitmap = new Bitmap(rectangle.Width, rectangle.Height, PixelFormat.Format24bppRgb);
Graphics graphics = Graphics.FromImage(bitmap);
BowTieController controller = new BowTieController(_session, loop, new PointF(1.0F, 1.0F));
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"?
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!