467,151 Members | 929 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,151 developers. It's quick & easy.

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

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
  • viewed: 1761
Share:
1 Reply
100+
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.

Similar topics

6 posts views Thread by Mario | last post: by
3 posts views Thread by Ryan Sullivan | last post: by
17 posts views Thread by Geoff Cox | last post: by
8 posts views Thread by Michael Satterwhite | last post: by
24 posts views Thread by Rhino | last post: by
11 posts views Thread by abico | last post: by
2 posts views Thread by EnjoyNews | last post: by
10 posts views Thread by cjparis | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.