Printing/Scaling Image

jantman
03-09-2006, 12:00 PM
Hello,

I have a bitmap image which I need to print. It is most likely taller than the page. How do I go about getting it to print on ONE page? What is the easiest way?

Thanks,
Jason

gnappi
03-10-2006, 09:18 PM
Hello,

I have a bitmap image which I need to print. It is most likely taller than the page. How do I go about getting it to print on ONE page? What is the easiest way?

Thanks,
Jason

I got this code from the MSDN site for an applet I wrote: You can scale the image up or down. Play with the width and height. Going ABOVE 1.0 makes the image larger, going BELOW 1.0 (LIKE 0.6) makes it smaller.

With PictureBox1
.Width = PictureBox1.Width
.Height = PictureBox1.Height
.Image = Image.FromFile(OpenFileDialog1.FileName)
.SizeMode = PictureBox1.SizeMode.Normal
.Width = PictureBox1.Image.Width * 1.3 ' needs some over size to keep 100% of image viewable
.Height = PictureBox1.Image.Height * 1.3 'needs some over size to keep 100% of image viewable
.BorderStyle = BorderStyle.Fixed3D
End With

Dim bmp As New Bitmap(Image.FromFile(OpenFileDialog1.FileName))
Dim bmp2 As New Bitmap( _
bmp.Width * 1.3, _
bmp.Height * 1.3, _
Imaging.PixelFormat.Format24bppRgb _
)
Dim g As Graphics = Graphics.FromImage(bmp2)
g.InterpolationMode = _
Drawing.Drawing2D.InterpolationMode.HighQualityBicubic
g.DrawImage(bmp, 0, 0, bmp2.Width, bmp2.Height)
Me.PictureBox1.Image = bmp2
Image_was_displayed = True
End If

If you mean printing for documentation or something out of VB.

The easiest way is to grab it into a MS Word document, size it by grabbing the edges, and printing. I have found that true color documents
like pics of people tend to print rather dark in Word.

jantman
03-11-2006, 11:49 AM
I appreciate the help, but I'm a bit confused.

I already have a BMP image saved to a file. I want to print it.

I understand the multiplying the size to scale it down, but how do I figure out how small to make it to fit on a page?

Essentially, I have a BMP file which has an unknown size (it was captured from the screen, and screensize may vary). I need to print it and get it all to fit on the sheet of paper. How do I do this?

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum