Plz help me guys on how to print the bitblt image. i am using the form or the picturebox to hold the bitblted image. Tnx and more power.
Printable View
Plz help me guys on how to print the bitblt image. i am using the form or the picturebox to hold the bitblted image. Tnx and more power.
Perhaps...
You may also need to set Orientation and/or scale image itself to fit paper - both technics can be found using search (there are plenty of samples posted).Code:Printer.PaintPicture Picture1.Picture 'or Picture1.Image
Many samples on BitBlt. I also have a few. xD Just search "BitBlt" in graphics and programming section, or even on here. =)
i tried already the paintpicture method but stil no image printed, is there any other way to print the bitblted image?
You have to make sure that the form's Autoredraw property is set to true, and scale mode is set to 3-pixel. Same with the picturebox.
how can i pass the bitblted image to a picturebox as picture so that i can print the content easily. maybe through printform method only. because when i get the .picture of a bitblted image in the picture box, it returns 0.
i already setted the scalemode to 3-pixels and autoredraw to true but still there is no image printed
Bitmaps get blted to the .Image and not the .Picture.
So you could print the .Image and not the .Picture.
Or you could set the .Picture to the .Image manually. Then use .Picture.
When you bitblt, are you using the .hDC, and not the image in that picturebox? LIke
Bitblt picPicture.hDC, 0, 0, intPictureWidth, intPictureHeight, Form1.picDestination.hdc, vbSrcCopy
yes, im bitblting using the .hdc of a picturebox, i also used the vbSrcCopy. What should i do then?
can u show the code that you have done so far?
here's how i bitblted the image,
'--------start
face.imgfback.ScaleMode = 1
With facecard_dummy
.Cls
.width = face.width
.height = face.height
.Picture1.width = face.imgfback.width
.Picture1.height = face.imgfback.height - 80
'face.imgfback.ScaleMode = 2
BitBlt .Picture1.hdc, 0, 0, .Picture1.width, .Picture1.height, face.imgfback.hdc, 0, 0, vbSrcCopy
End With
'face.imgfback.ScaleMode = 3
face.imgfback.ScaleMode = 1
'------end
Try this:
If that doesn't work, can u try to attack you whole project? Maybe some other code is conflicting as well. You never know. =)Code:'--------start
face.imgfback.ScaleMode = 3
Picture1.ScaleMode = 3
With facecard_dummy
.Cls
.width = face.width
.height = face.height
.Picture1.width = face.imgfback.width
.Picture1.height = face.imgfback.height - 80
'face.imgfback.ScaleMode = 2
end with
BitBlt Picture1.hdc, 0, 0, Picture1.width, Picture1.height, face.imgfback.hdc, 0, 0, vbSrcCopy
'face.imgfback.ScaleMode = 3
face.imgfback.ScaleMode = 1
'------end
if i used that code, how can i print the bitblted image?
Try this:
- Make sure the PictureBox's AutoRedraw is True
- Blt image to the PictureBox
- Printer.PaintPicture PictureBox.Image, ....
you want to print it? Like after it has been bitblted to the destination? Well, you could do what FireXTol said. =)
i tried that already but i got the problem on the bitblted image, it includes the objects around. unlike when i setted the autoredraw to false it only gets the precise image but no image on printing. what should i do?
is there a way to pass the bitblted image to the other picture box?
can you show to me the complete sample code 4 that? do i need also to consider the scalemode of the picturebox and the scalemode of a printer?
vb Code:
face.imgfback.ScaleMode = 1 With facecard_dummy .Cls .width = face.width .height = face.height .Picture1.width = face.imgfback.width .Picture1.height = face.imgfback.height - 80 'face.imgfback.ScaleMode = 2 .Picture1.AutoRedraw = True 'step 1 BitBlt .Picture1.hdc, 0, 0, .Picture1.width, .Picture1.height, face.imgfback.hdc, 0, 0, vbSrcCopy 'step 2 'Now either print the Picture1.Image, or: 'Picture1.Picture = Picture1.Image 'now print the Picture1.Picture End With 'face.imgfback.ScaleMode = 3 face.imgfback.ScaleMode = 1
tnx for your idea guys, i got it already. You had contributed much to this solution. God Bless and More Power to you guys
xD Glad i could help with what i can. mainly others did more, but np. =) Can u please mark this thread resolved then? At the top of your first post, in the blue, it has Thread Tools, and then Mark Thread Resolved. Thanks!