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

Need to print an image which is larger than the screen???

P: 7
Hi,

Can someone please help me with finding some code to print an image which is larger than the screen?

I am trying to print a black background which is exactly A4 in height and width, yet even tho i pasted an image onto the form at that size, it gets cut off by the screen Because the screen isn't big enough.

I do not necessarily need to see it on screen properly, but i require it to print a black image 210mm wide and 297mm height.

Please help, its quite urgent??

Much Appreciated,
Robert
Nov 22 '06 #1
Share this Question
Share on Google+
1 Reply


100+
P: 267
Hi,

Can someone please help me with finding some code to print an image which is larger than the screen?

I am trying to print a black background which is exactly A4 in height and width, yet even tho i pasted an image onto the form at that size, it gets cut off by the screen Because the screen isn't big enough.

I do not necessarily need to see it on screen properly, but i require it to print a black image 210mm wide and 297mm height.

Please help, its quite urgent??

Much Appreciated,
Robert
hi

this a nasty habbit of vb ..
try using the following code, note however that resolution is not as good as the printdoc method

you need to put a picturebox on your form (Pic1)
Flat, NoBorder
in this case Form1 is being printed, but you may use any object as long as the property hWnd exist.


Expand|Select|Wrap|Line Numbers
  1.  
  2. Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
  3.  
  4.  

Expand|Select|Wrap|Line Numbers
  1.  
  2.     With Form1
  3.     .pic1.Left = 0
  4.     .pic1.Top = 0
  5.     .pic1.Width = 12000
  6.     .pic1.Height = 16500
  7.     .pic1.AutoRedraw = True
  8.     .pic1.ZOrder
  9.     .Refresh
  10.     rv = SendMessage(.hWnd, &HF, .pic1.hDC, 0)
  11.     rv = SendMessage(.hWnd, &H317, .pic1.hDC, &H34&)
  12.     .pic1.Picture = .pic1.Image
  13.     .pic1.ZOrder
  14.     Printer.Orientation = 1
  15.     Printer.PaintPicture .pic1.Picture, 0, 400, Printer.Width, Printer.Height, 0, 0, .pic1.Width, .pic1.Height
  16.    Printer.EndDoc
  17.  
  18.  
Nov 22 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.