Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB6 Printing

Status
Not open for further replies.

domt

Programmer
Mar 13, 2001
115
US
I'm trying to print a frame and am having trouble:

1. Text in labels is rearainged by the printer.

2. The frame Backcolor is Button Face as are the Backcolor of my labels, but when printed, the backcolor of the labels are dark, which doesn't look good.

3.I can't get a Pie Chart to print. Its on a Picture box and the redraw is True.

Can anyone help?
Dom
 

1. Don't know what to tell you about the printer and the rearrangment of the text except that you printer may not support the font.

2. Make label transparent

3. Are you use paintpicture?

Good Luck

 
Thanks for your response.
I am drawing a pie chart on a Picture Box.
How do I use Paintpicture?

Here is my code:

Dim Col(10) As Long
With Picture2
.Visible = True
.Left = 9480
.Top = 3240
End With
Col(1) = &H80000005 'white
Col(2) = &HC0FFFF
Col(3) = &HFFC0FF
Col(4) = vbGreen 'green
Col(5) = vbYellow 'yellow
Col(6) = &H80C0FF 'orange
Col(7) = vbRed 'red
Col(8) = &HFF00FF 'light purple
Col(9) = &HC000C0 'purple
arc1 = 0
arc2 = 0.00001
For ct = 1 To 9
arc1 = arc2
arc2 = arc1 + 6.28 * Val(Label34(ct).Caption) / Val(Label34(0))
If ct = 9 Then
arc2 = arc2 - 0.00001
End If
Picture2.FillColor = Col(ct)
If Val(Label34(ct).Caption) > 0 Then
Picture2.Circle (Picture2.ScaleWidth / 2, Picture2.ScaleHeight / 2), _
Picture2.ScaleHeight / 2.5, , -arc1, -arc2
End If
Next

It works fine on the monitor but it doesn't print.
 

Printer.PaintPicture...

Look it up in help. It is a graphics method to print graphical object to a printer object

Good Luck

 
"Help" gives little guidance for what I want to do.
I have to print a Frame containing the Pie Chart which is constructed by a For Next procedure, as shown in my code.
Every arraingment of PaintPicture I try returns an error message.
Dom
 

For what you want to do you are going to either have to use the printform method or you are going to need to get dirty with the printer object (or take a screen shot and print that, search this site there is some code floating around on how to take a screen shot). You will need to use the current x and y properties and the printer.print method to print your text and also use the current x and y properties to position your graphic...
[tt]
Printer.PaintPicture Picture1.Picture, leftpositionofdest, toppositionofdest, optionalwidthofdest, optionheightofdest, clippingregionofsourceleft, clippingregionofsourcetop, widthofclippingregion, heightofclippingregion, optionalcode
[/tt]
where leftpositionofdest=the left edge of where you want the graphic to appear on the paper and toppositionofdest = the top edge of where you want the graphic to appear on the paper ....

Good Luck

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top