Best way to print high resolution images

  • Thread starter Thread starter moondaddy
  • Start date Start date
M

moondaddy

I have an application where I need to print images where the size has been
reduced down to a fraction of a thumbnail and the original image is several
inches high and wide. We're using a special printing process where the dpi
is 2000x2000 or higher, therefore, when I reduce the size of the image, I
don't want to loose any pixels. In other words, if the image is 200 px by
200 px and I reduce the size down to 1/4 inch, I want the printer to still
read all 200x200 pixels.

The images are located on a remote web server so I can use asp.net, sql
server reporting services, or a winforms app using web services. I don't
want to use crystal reports. Can anyone recommend a good method to do this?

Thanks.
 
Hi,

I think once an image has been resized to a lower resolution one, it can
not be restored, because the color information has lost.
For your scenario, I think you may try to use the method below to generate
the thumbnail dynamically.
public bool ThumbnailCallback()
{
return false;
}

private void Form1_Load(object sender, System.EventArgs e)
{
Image img = Image.FromFile(@"c:\Test\TestPIC\a.bmp");
this.pictureBox1.Image = img;
Image.GetThumbnailImageAbort myCallback =
new Image.GetThumbnailImageAbort(ThumbnailCallback);
this.pictureBox2.Image =
img.GetThumbnailImage(32,32,myCallback,IntPtr.Zero);
}

Image.GetThumbnailImage Method
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemdrawingimageclassgetthumbnailimagetopic.asp

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Moondaddy,

To add something to the nice answer from Peter here a sample to make a
thumbnail in VBNet.

Dim fo As New OpenFileDialog
If fo.ShowDialog = DialogResult.OK Then
PictureBox1.Image = PictureBox1.Image.FromFile(fo.FileName)
Dim Thumbnail As System.drawing.Image = _
PictureBox1.Image.GetThumbnailImage(32, 32, Nothing, New IntPtr)
PictureBox2.Image = Thumbnail
End If

Just a little thing to help more

Cor
 
Thanks Peter and Cor.

I would like to clarify on a few things. Does this method maintain the same
number of pixels in the image even though it was shrunk from 200X200 pixels
to 32X32 pixels for example?

Your examples use the picturebox control. Since I need to create some sort
of dynamic report (I could have 5 or 500 tiny images on a page) using these
high resolution images, a winform with picture boxes wont work. I need to
use a reporting app like sql server reporting services, or possible an
asp.net page with a datagrid or something (however printing from a web page
may not be too elegant). We need to print these tiny image using a special
printer and paper for our process, so having precision control over the
layout is important.

any more feedback would be most appreciated.
 
Hi,

GetThumbnailImage will not maintain the original resolution.
e.g.
image2 = image1.GetThumbnailImage

the image1 is 1024X768 while the image2 is 32X32.
Then after print, the image1 will be of 1024X768, while the image2 will be
of 32X32.

So for you scenario, I think we have to maintain two copies for one image,
one is the tiny version for display, and the other is the original version
for print.
By using the GetThumbnailImage, we do not need to store two copies, as we
can generate the tiny version every time we call the GetThumbnailImage.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Thanks Peter but I failed to communicate what I'm trying to do. The small
images are not for viewing. The small images are what I want to print. I
need to print tiny images at very high resolution. We are producing a
product that has small images on it and we have a printing process that can
produce high resolution detail on very small images. This is why I want to
reduce the size of the image while maintaining high resolution such as 600
dpi or higher.
 
Hi,

You may try to draw the image as a small size, but the original image needs
high resolution.
Image img;
private void Form1_Load(object sender, System.EventArgs e)
{
this.pictureBox1.Image =img;
}

private void pictureBox2_Paint(object sender,
System.Windows.Forms.PaintEventArgs e)
{
if (img !=null)
e.Graphics.DrawImage(img,0,0,32,32);
}

Is this what you want?

I am not sure your scenario, but I think when we print we can just print
the image of high resolution to get the good print effect.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top