473,322 Members | 1,403 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Best way to print high resolution images

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
6 4985
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

131
by: Peter Foti | last post by:
Simple question... which is better to use for defining font sizes and why? px and em seem to be the leading candidates. I know what the general answer is going to be, but I'm hoping to ultimately...
2
by: Ben Amada | last post by:
Hi group. I'm going to display a low resolution image in an HTML page. On the web server, I have a high resolution version of that image. If I display the high resolution image in the browser...
1
by: Johnny Granberg | last post by:
Im trying to make a software in VB.NET that is supposed to handle high-res images, ive discovered theres a limit in the size of the bitmap object around 10000x10000 pixels. The program takes a...
0
by: clashway | last post by:
It took me so long to figure this out, I thought I would share it. This prints an MSChart using the metafilepict format after copying the chart to the clipboard. This provides a high-resolution...
1
by: kelsloris | last post by:
I'm printing a combination of text and graphics to the printer. When I print to my HP Laserjet, everything comes out ok. If I print to my Canon Inkjet photo printer (i475D series), all I get is...
3
by: Yofnik | last post by:
Hello all, I need your help. Internet Explorer 6+ has a registry setting (UseHR) that will automatically scale images for displays with high resolution (DPI). I am building a web based...
4
by: tburger | last post by:
I've recently started my first web project and was wondering what people thought about resolution/screen size when laying out a site? Is there a best way to ensure a high quality, universal look...
41
by: Cartoper | last post by:
I hear it is possible to disable the web browsers print function, does anyone know how to do that?
11
by: Usenet User | last post by:
..NET 1.1/2.0 I have a need to display high-resolution scrollable images in a .NET application (Windows Forms). One well known solution is to create a Panel with AutoScroll set to "true" and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.