|
-
Dec 4th, 2001, 03:43 PM
#1
Thread Starter
Frenzied Member
blt problems
I want to copy the contents of a picturebox called picture3 into an invisible picturebox called picHold so that I can print it.
Why doesnt this work properly? I get an image that looks nowhere near what the original picture box looks like.
VB Code:
BitBlt picHold.hDC, 0, 0, Picture3.Width, Picture3.Height, frmPrintAvailability.hDC, Picture3.Left, Picture3.Top, vbSrcCopy
Printer.PaintPicture picHold.Image, 0, 0
Printer.EndDoc
-
Dec 4th, 2001, 04:30 PM
#2
Frenzied Member
Try this...
VB Code:
'can be set in the properties window
picHold.ScaleMode = vbPixel
Picture3.ScaleMode = vbPixel
BitBlt picHold.hDC, 0, 0, Picture3.ScaleWidth, Picture3.ScaleHeight, Picture3.hDC, 0, 0, vbSrcCopy
Printer.PaintPicture picHold.Image, 0, 0
Printer.EndDoc
Greg
Free VB Add-In - The Reference Librarian
Click Here for screen shot and download link.
-
Dec 4th, 2001, 05:59 PM
#3
PowerPoster
Originally posted by gdebacker
Try this...
VB Code:
'can be set in the properties window
picHold.ScaleMode = vbPixel
Picture3.ScaleMode = vbPixel
BitBlt picHold.hDC, 0, 0, Picture3.ScaleWidth, Picture3.ScaleHeight, Picture3.hDC, 0, 0, vbSrcCopy
Printer.PaintPicture picHold.Image, 0, 0
Printer.EndDoc
Greg
Yes, and no.
Make sure the Scale mode of the picture boxes are the same as each other, and the form they are housing them in, but don't change your original code.
Greg, the code you gave doesn't actually work in this instance, as I am not sure, but I think he may have got this idea from a post of mine, or at least has the same idea as me.
Using the .hDC of the Picture doesn't copy any controls which may be housed in that picture box, so you need the form.hDC which it is in, and you need to reference the X,Y of the pictureBox on the form.
-----------------------------------------
-RJ
[email protected]
-----------------------------------------
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
|