Solved

PrintForm and Draws

Posted on 1998-11-19
10
222 Views
Last Modified: 2010-08-05
How can You print a Form with draws obtained with Pset and/or Circle inside a PictureBox ?
0
Comment
Question by:jabrantes
  • 5
  • 3
  • 2
10 Comments
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1445650
Try this:
'put this in a module
Declare Function BitBlt Lib "gdi32" Alias "BitBlt" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long

BitBlt Printer.hDC, 10, 10, form1.width, form1.height, form1.hdc, 0,0, vbSrcCopy

Tell me how it goes
0
 

Author Comment

by:jabrantes
ID: 1445651
Dear MikeP

Thank you for your answer, but it not work.
I had tried to do like this:

'Inside one Module
Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long

Sub main()

Load Form1
Form1.Show

End Sub

'The Form1 have one PictureBox(Picture1) and a CommandBottom (Command1) and the code is:

Private Sub Picture1_Click()

Picture1.Scale (0, 0)-(100, 100)
Picture1.Circle (50, 50), 20

End Sub

Private Sub Command1_Click()
BitBlt Printer.hDC, 10, 10, Form1.Width, Form1.Height, Form1.hDC, 0, 0, vbSrcCopy

End Sub


So, I ask you for some other suggestion.

Thank you
0
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1445652
Did you simply try PrintForm?
What errors do you get with the code above?
0
 

Author Comment

by:jabrantes
ID: 1445653
PrintForm function, with AutoRedraw set to True or to False, only gives a clean PictureBox, without the circle.
The above code don't give any kind of error, but don't work.
If you have more suggestion, please tell me.

Thanks
0
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1445654
Reject my answer for now, if I'll have any suggestions, I'll post.
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

Author Comment

by:jabrantes
ID: 1445655
Adjusted points to 300
0
 
LVL 1

Expert Comment

by:Aleck
ID: 1445656
What is your Version VB?
0
 

Author Comment

by:jabrantes
ID: 1445657
I have the VB5
0
 
LVL 1

Accepted Solution

by:
Aleck earned 300 total points
ID: 1445658
draw in the printer.

 Printer.Scale (0, 0)-(100, 100)
 Printer.Circle (50, 50), 20
 Printer.EndDoc
0
 

Author Comment

by:jabrantes
ID: 1445659
With your suggestion, the printer only gives the circle, not all the Form.
Now I have the PrintForm function to obtain one part of the screen and your suggestion to obtain the other. So, how can I combine the two methods ?
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now