×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

image quality needs improvement

image quality needs improvement

image quality needs improvement

(OP)
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"?

RE: image quality needs improvement

Do youy have the ability to set the dpi in the pdf? Monitor resolution is 72dpi. Standard printing is over 200dpi (usually 300). If it looks okay on the screen, but not on the print out, that's probably your issue.

Just doubling the resolution of an image is not going to make it better. You need appropriately sized source images, or you will get some blurring when you upsize them.

Lodlaiden

You've got questions and source code. We want both!
Here at tek tips, we provide a hand up, not a hand out.

RE: image quality needs improvement

(OP)
No, that didn't help, but I found that adding this lines solves half the problem:

PdfExport.ImageQuality = ImageQuality.Highest;

RE: image quality needs improvement

Have you saved the image out on it's own to validate that it is fine before pdf compositing?

You've got questions and source code. We want both!
Here at tek tips, we provide a hand up, not a hand out.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close