Software

Our forums are currently in maintenance mode and the ability to post is disabled. We will be back up and running as soon as possible. Thanks for your patience!

Question

Printer.PaintPicture pic.Picture, 0, 0, pic.Width, pic.Height

By bkandler ·
This ought to be trivial. I have a large picturebox filled with lines and fills in twips and I need to break it into page size pieces. There are many samples that are based on the above statement. But I get "invalid picture". Trying variations the only one that doesn't error is

Printer.PaintPicture pic.Image, 0, 0, pic.Width, pic.Height
But it produces nothing!

Else where in my code, I have

If SetupPrinter(Me) Then
pic.Picture = pic.Image
Printer.PaintPicture pic.Picture, Printer.CurrentX, Printer.CurrentY
Printer.EndDoc
End If

that works grand. But in this case:

pic.Picture = pic.Image

Erases the picturebox.
Thread display: Collapse - | Expand +

All Answers

Collapse -

Need more information

by birdmantd Moderator In reply to Printer.PaintPicture pic. ...

What is the application/program used? I cannot guess what you are using or what the issue is.

Collapse -

paintpicture failure

by bkandler In reply to Need more information

it's a home grown vb6 app with over 5000 users.

in the same program this works:

cmdColor.picSide.Picture = cmdColor.picSide.Image
Printer.PaintPicture cmdColor.picSide.Picture, Printer.TextWidth(ini.LinePfx), Printer.CurrentY

but this does not

DisplayRingTop Me.pic, lyr, True
DrawCenterMarks Me.pic, ini.CenterJigPost / 2, 0
Me.pic.Picture = Me.pic.Image
Printer.PaintPicture Me.pic.Picture, 0, 0, pic.Width, pic.Height

The setup for both is the same unit (inches) and scalemode settings save sizes. DisplayRingTop actually used in both places. I can send pics and more code.

Collapse -

paintpicture failure

by bkandler In reply to paintpicture failure

pared down to the minimum, this prints an empty page. GO shows up in pic:

pic.Print "GO"
Printer.PaintPicture Me.pic.Image, 0, 0, pic.Width, pic.Height
Printer.EndDoc

and this results in invalid picture

pic.Print "GO"
pic.Picture = pic.Image
Printer.PaintPicture Me.pic.Picture, 0, 0, pic.Width, pic.Height
Printer.EndDoc

In other places, this works:

cmdColor.picSide.Picture = cmdColor.picSide.Image 'capture image
Printer.PaintPicture cmdColor.picSide.Picture, Printer.TextWidth(ini.LinePfx), Printer.CurrentY 'print it

Collapse -

I'm too late.

by rproffitt Moderator In reply to Printer.PaintPicture pic. ...

Last year our office finally did the end of support for a few VB6 apps. It was time for a few reasons but mostly because the setup was getting harder and harder and the client didn't agree to pay for continued work or conversion to something more current.

So my access to VB6 is no more. I've also found that the other forums have all but gone silent on VB6 discussions.

I know folk want to keep going but here, it's dead Jim.

Maybe you can outsource this on Upwork or such?

Collapse -

it's a home grown vb6 app with over 5000 users.

by lineardxca In reply to Printer.PaintPicture pic. ...

Yes I'm sure its that

Collapse -

by rofa

by rofamarja In reply to Printer.PaintPicture pic. ...

pared down to the minimum, this prints an empty page.

Related Discussions

Related Forums