|
-
Jul 9th, 2010, 03:57 AM
#1
Thread Starter
Member
[RESOLVED] how to print the bitblt image
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.
-
Jul 9th, 2010, 07:32 AM
#2
Re: how to print the bitblt image
Perhaps...
Code:
Printer.PaintPicture Picture1.Picture 'or Picture1.Image
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).
-
Jul 9th, 2010, 05:13 PM
#3
Fanatic Member
Re: how to print the bitblt image
Many samples on BitBlt. I also have a few. xD Just search "BitBlt" in graphics and programming section, or even on here. =)
-
Jul 11th, 2010, 08:57 PM
#4
Thread Starter
Member
Re: how to print the bitblt image
i tried already the paintpicture method but stil no image printed, is there any other way to print the bitblted image?
-
Jul 11th, 2010, 09:14 PM
#5
Fanatic Member
Re: how to print the bitblt 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.
-
Jul 11th, 2010, 10:05 PM
#6
Thread Starter
Member
Re: how to print the bitblt image
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.
-
Jul 11th, 2010, 10:19 PM
#7
Thread Starter
Member
Re: how to print the bitblt image
i already setted the scalemode to 3-pixels and autoredraw to true but still there is no image printed
-
Jul 11th, 2010, 10:32 PM
#8
Re: how to print the bitblt image
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.
Last edited by FireXtol; Jul 12th, 2010 at 10:34 PM.
Software I use and highly recommend: Opera, Miranda IM, Peerblock, Winamp, Unlocker Assistant, JoyToKey, Virtual CloneDrive, Secunia PSI, ExplorerXP, GOM Player, Real Alternative, Quicktime Alternative,Sumatra PDF, and non-freeware: Photoshop and VB6( ).
My codebank: AllRGB, Rounded Rectangle(math), Binary Server, Buddy Paint, LoadPictureGDI+, System GUID/Volume Serial, HexToAsc, List all processes and their paths, quasiString matching
Strings(search, extraction, retrieval etc): Retrieve BBCode Link from HTML, RemoveBetween ()'s, strFindBetween(str1,str2), Insert text in HTML, HTML - GetSpanByID
-
Jul 11th, 2010, 11:48 PM
#9
Fanatic Member
Re: how to print the bitblt image
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
-
Jul 12th, 2010, 01:13 AM
#10
Thread Starter
Member
Re: how to print the bitblt image
yes, im bitblting using the .hdc of a picturebox, i also used the vbSrcCopy. What should i do then?
-
Jul 12th, 2010, 12:35 PM
#11
Fanatic Member
Re: how to print the bitblt image
can u show the code that you have done so far?
-
Jul 12th, 2010, 07:12 PM
#12
Thread Starter
Member
Re: how to print the bitblt image
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
-
Jul 12th, 2010, 08:53 PM
#13
Fanatic Member
Re: how to print the bitblt image
Try this:
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 that doesn't work, can u try to attack you whole project? Maybe some other code is conflicting as well. You never know. =)
-
Jul 12th, 2010, 09:45 PM
#14
Thread Starter
Member
Re: how to print the bitblt image
if i used that code, how can i print the bitblted image?
-
Jul 12th, 2010, 10:32 PM
#15
Re: how to print the bitblt image
Try this:
- Make sure the PictureBox's AutoRedraw is True
- Blt image to the PictureBox
- Printer.PaintPicture PictureBox.Image, ....
Software I use and highly recommend: Opera, Miranda IM, Peerblock, Winamp, Unlocker Assistant, JoyToKey, Virtual CloneDrive, Secunia PSI, ExplorerXP, GOM Player, Real Alternative, Quicktime Alternative,Sumatra PDF, and non-freeware: Photoshop and VB6( ).
My codebank: AllRGB, Rounded Rectangle(math), Binary Server, Buddy Paint, LoadPictureGDI+, System GUID/Volume Serial, HexToAsc, List all processes and their paths, quasiString matching
Strings(search, extraction, retrieval etc): Retrieve BBCode Link from HTML, RemoveBetween ()'s, strFindBetween(str1,str2), Insert text in HTML, HTML - GetSpanByID
-
Jul 12th, 2010, 11:39 PM
#16
Fanatic Member
Re: how to print the bitblt image
you want to print it? Like after it has been bitblted to the destination? Well, you could do what FireXTol said. =)
-
Jul 13th, 2010, 12:59 AM
#17
Thread Starter
Member
Re: how to print the bitblt image
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?
-
Jul 13th, 2010, 12:59 AM
#18
Thread Starter
Member
Re: how to print the bitblt image
is there a way to pass the bitblted image to the other picture box?
-
Jul 13th, 2010, 01:40 AM
#19
Thread Starter
Member
Re: how to print the bitblt image
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?
-
Jul 13th, 2010, 01:45 PM
#20
Re: how to print the bitblt image
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
Software I use and highly recommend: Opera, Miranda IM, Peerblock, Winamp, Unlocker Assistant, JoyToKey, Virtual CloneDrive, Secunia PSI, ExplorerXP, GOM Player, Real Alternative, Quicktime Alternative,Sumatra PDF, and non-freeware: Photoshop and VB6( ).
My codebank: AllRGB, Rounded Rectangle(math), Binary Server, Buddy Paint, LoadPictureGDI+, System GUID/Volume Serial, HexToAsc, List all processes and their paths, quasiString matching
Strings(search, extraction, retrieval etc): Retrieve BBCode Link from HTML, RemoveBetween ()'s, strFindBetween(str1,str2), Insert text in HTML, HTML - GetSpanByID
-
Jul 13th, 2010, 09:48 PM
#21
Thread Starter
Member
Re: how to print the bitblt image
tnx for your idea guys, i got it already. You had contributed much to this solution. God Bless and More Power to you guys
-
Jul 13th, 2010, 10:07 PM
#22
Fanatic Member
Re: how to print the bitblt image
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!
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
|