-
Oct 16th, 2021, 04:38 AM
#1
Thread Starter
PowerPoster
WITH PRINTER...image
pseudo code:
Code:
with printer
....
Printer.Print ""
picBarCode.AutoRedraw = True
Printer.PaintPicture picBarCode.Image, 0, 0, picBarCode.Width, picBarCode.Height
....
Printer.EndDoc
End With
when i print the doc the picBarCode, is printed on the top of document!, and not to the bottom...
note:
- picBarCode is a picturebox on form
- and i need to center orizonthal the image
-
Oct 16th, 2021, 05:59 AM
#2
Re: WITH PRINTER...image
You told it to paint the picture at coordinates (0, 0) so it is doing as requested.
Centering is pretty easy. Use an X-offset value that is 0.5 * (DestWidth - PictureWidth).
-
Oct 16th, 2021, 06:36 AM
#3
Thread Starter
PowerPoster
Re: WITH PRINTER...image
Originally Posted by dilettante
You told it to paint the picture at coordinates (0, 0) so it is doing as requested.
Centering is pretty easy. Use an X-offset value that is 0.5 * (DestWidth - PictureWidth).
???
Example, please.
and....
how to the code know to print the image to the and of last line printed?
in effect, i have a similar code:
whith printer
...
Printer.Print "------------------------------------------------------------"
Printer.Print ""
Printer.Print "test1"
Printer.Print "test2"
Printer.Print "test3"
Printer.Print "..."
Printer.Print "this is last line"
<here i need to print the image
end with
note:
the number of line are variable
Last edited by luca90; Oct 16th, 2021 at 10:29 AM.
-
Oct 16th, 2021, 04:51 PM
#4
Re: WITH PRINTER...image
Checkout the CurrentX, CurrentY Properties in VB help
-
Oct 16th, 2021, 05:05 PM
#5
Re: WITH PRINTER...image
The PaintPicture() method has no relationship with CurrentX or CurrentY.
-
Oct 16th, 2021, 05:09 PM
#6
Re: WITH PRINTER...image
luca---YOU do it...dile laid it out in pretty plain English...
Sam I am (as well as Confused at times).
-
Oct 16th, 2021, 05:31 PM
#7
Re: WITH PRINTER...image
Originally Posted by dilettante
The PaintPicture() method has no relationship with CurrentX or CurrentY.
But in theory you could retrieve the currentx and currenty and pass those to the paint picture function
-
Oct 16th, 2021, 05:36 PM
#8
Re: WITH PRINTER...image
Dile
I was thinking about a line like
Code:
Printer.PaintPicture picBarCode.Image, Printer.CurrentX, Printer.CurrentY, picBarCode.Width, picBarCode.Height
From post #3 it looks like the OP wants the Picture printed after the last line of text.
-
Oct 16th, 2021, 05:47 PM
#9
Hyperactive Member
Re: WITH PRINTER...image
Top middle:
Code:
Printer.PaintPicture picBarCode.Image, (Printer.Width - picBarCode.ScaleWidth) / 2, 0, picBarCode.ScaleWidth, _
picBarCode.ScaleHeight, 0, 0, picBarCode.ScaleWidth, picBarCode.ScaleHeight, vbSrcCopy
Bottom middle:
Code:
Printer.PaintPicture picBarCode.Image, (Printer.Width - picBarCode.ScaleWidth) / 2, (Printer.Height - picBarCode.ScaleHeight), _
picBarCode.ScaleWidth, picBarCode.ScaleHeight, 0, 0, picBarCode.ScaleWidth, picBarCode.ScaleHeight, vbSrcCopy
-
Oct 16th, 2021, 07:08 PM
#10
Re: WITH PRINTER...image
Originally Posted by Magic Ink
From post #3 it looks like the OP wants the Picture printed after the last line of text.
Could be. I mostly got "please write this line of code for me" once again.
-
Oct 16th, 2021, 08:22 PM
#11
Re: WITH PRINTER...image
Exactly, dile....that is why i posted #6!
Sam I am (as well as Confused at times).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|