By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,732 Members | 1,397 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,732 IT Pros & Developers. It's quick & easy.

Best way to print high resolution images

P: n/a
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.

--
mo*******@nospam.com
Nov 21 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
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/de...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.

Nov 21 '05 #2

P: n/a
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
Nov 21 '05 #3

P: n/a
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.


--
mo*******@nospam.com
"Cor Ligthert" <no**********@planet.nl> wrote in message
news:eF**************@tk2msftngp13.phx.gbl...
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

Nov 21 '05 #4

P: n/a
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.

Nov 21 '05 #5

P: n/a
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.

--
mo*******@nospam.com
""Peter Huang"" <v-******@online.microsoft.com> wrote in message
news:02*************@cpmsftngxa06.phx.gbl...
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.

Nov 21 '05 #6

P: n/a
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.

Nov 21 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.