hello my project is nearly ready but i got a problem in printing a specific .jpg out of a picturebox.
in my opinion the problem is that the .jpg is too big because another .jpg iam able to print easy but this one is much tinier than the other one.
i tried different solutions but it doesnt wanna work i hope u can help me with it..i created a project just with the .jpg inside and a simple picturebox and commandbutton with the code i used
http://www.file-upload.net/download-.../test.rar.html
please help me i tried this for a long time now
/edit ok for those who dont wanna download:
Private Sub Command1_Click()
Dim wid As Single
Dim hgt As Single
' Set the PictureBox's ScaleMode to pixels to
' make things interesting.
Picture1.ScaleMode = vbPixels
' Print the picture.
Printer.PaintPicture Picture1.Picture, _
3508, 2479
' Get the picture's dimensions in the printer's
' scale mode.
wid = ScaleX(Picture1.ScaleWidth, Picture1.ScaleMode, Picture1.ScaleMode)
hgt = ScaleY(Picture1.ScaleHeight, Picture1.ScaleMode, Picture1.ScaleMode)
' Draw the box.
Printer.Line (3508, 2479)-Step(wid, hgt), , B
' Finish printing.
Printer.EndDoc
'other method
'Printer.PaintPicture Picture1.Picture, Printer.Width / 2, Printer.Height / 2
'Printer.EndDoc
End Sub
the image got the size: 3508x2479 pixels
in my opinion the problem is that the .jpg is too big because another .jpg iam able to print easy but this one is much tinier than the other one.
i tried different solutions but it doesnt wanna work i hope u can help me with it..i created a project just with the .jpg inside and a simple picturebox and commandbutton with the code i used
http://www.file-upload.net/download-.../test.rar.html
please help me i tried this for a long time now
/edit ok for those who dont wanna download:
Quote:
Private Sub Command1_Click()
Dim wid As Single
Dim hgt As Single
' Set the PictureBox's ScaleMode to pixels to
' make things interesting.
Picture1.ScaleMode = vbPixels
' Print the picture.
Printer.PaintPicture Picture1.Picture, _
3508, 2479
' Get the picture's dimensions in the printer's
' scale mode.
wid = ScaleX(Picture1.ScaleWidth, Picture1.ScaleMode, Picture1.ScaleMode)
hgt = ScaleY(Picture1.ScaleHeight, Picture1.ScaleMode, Picture1.ScaleMode)
' Draw the box.
Printer.Line (3508, 2479)-Step(wid, hgt), , B
' Finish printing.
Printer.EndDoc
'other method
'Printer.PaintPicture Picture1.Picture, Printer.Width / 2, Printer.Height / 2
'Printer.EndDoc
End Sub