printing graphs in VB 5.0 CCE 
Author Message
 printing graphs in VB 5.0 CCE

Hi, I am having a problem printing from VB
I have a program that plots a graph to the screen according to certain X
and Y values.  How do I send this graph to the printer.  I would prefer if
I didn't have to print the entire form (i.e.: title bar).  Any help would
be appreciated..  

Thanks in advance

--
Ryan Haggarty

TIP #1990



Sun, 25 Jul 1999 03:00:00 GMT  
 printing graphs in VB 5.0 CCE

You should graph in a PictureBox. And the use the PaintPicture method of
the Printer object in a code like this:

Dim pw as Integer
Dim ph as Integer
pw=Picture1.Width
ph=Picture1.Height
Printer.PaintPicture Picture1, 0, 0, pw, ph, 0, 0, pw, ph, &hCC0020

I didn't tried it but anyway, it should work..
If it doesn't work, try changing the autoredraw property of Picture1

Hope this helps, and hope this works...

===================================
Pedro J. Rusjan

http://www.mug.org.ar/socios/pedro.rusjan
===================================



Quote:
> Hi, I am having a problem printing from VB
> I have a program that plots a graph to the screen according to certain X
> and Y values.  How do I send this graph to the printer.  I would prefer
if
> I didn't have to print the entire form (i.e.: title bar).  Any help would
> be appreciated..  

> Thanks in advance

> --
> Ryan Haggarty

> TIP #1990



Thu, 29 Jul 1999 03:00:00 GMT  
 printing graphs in VB 5.0 CCE

Note that the image format for the graph may be metafile; this is often the
case
with graphing controls (it only makes sense with all the lines). This fact
can cause
issues with the PaintPicture method. If all else fails, if your graph
control has the ability
to save as a bitmap, you can save it to disk and then reopen it in the
picturebox. This will
obviously inflict a serious performance hit.

--
Chris Behrens

Microsoft Site Builder Level 2
http://www.deltav.net

"Are we not drawn onward, we few, drawn onward
to new era?"



Quote:
> You should graph in a PictureBox. And the use the PaintPicture method of
> the Printer object in a code like this:

> Dim pw as Integer
> Dim ph as Integer
> pw=Picture1.Width
> ph=Picture1.Height
> Printer.PaintPicture Picture1, 0, 0, pw, ph, 0, 0, pw, ph, &hCC0020

> I didn't tried it but anyway, it should work..
> If it doesn't work, try changing the autoredraw property of Picture1

> Hope this helps, and hope this works...

> ===================================
> Pedro J. Rusjan

> http://www.mug.org.ar/socios/pedro.rusjan
> ===================================



> > Hi, I am having a problem printing from VB
> > I have a program that plots a graph to the screen according to certain
X
> > and Y values.  How do I send this graph to the printer.  I would prefer
> if
> > I didn't have to print the entire form (i.e.: title bar).  Any help
would
> > be appreciated..  

> > Thanks in advance

> > --
> > Ryan Haggarty

> > TIP #1990



Fri, 30 Jul 1999 03:00:00 GMT  
 printing graphs in VB 5.0 CCE

Quote:
> Dim pw as Integer
> Dim ph as Integer
> pw=Picture1.Width
> ph=Picture1.Height
> Printer.PaintPicture Picture1, 0, 0, pw, ph, 0, 0, pw, ph, &hCC0020

> I didn't tried it but anyway, it should work..
> If it doesn't work, try changing the autoredraw property of Picture1

> Hope this helps, and hope this works...

Yes, thanks, this worked great (I just had to change Picture1 to
Picture1.image in the last part.)

Thanks

--
Ryan Haggarty

TIP #1990



Sun, 01 Aug 1999 03:00:00 GMT  
 printing graphs in VB 5.0 CCE

Quote:
> Note that the image format for the graph may be metafile; this is often
the
> case
> with graphing controls (it only makes sense with all the lines). This
fact
> can cause
> issues with the PaintPicture method. If all else fails, if your graph
> control has the ability
> to save as a bitmap, you can save it to disk and then reopen it in the
> picturebox. This will
> obviously inflict a serious performance hit.

No, the advice worked fine.  

--
Ryan Haggarty

TIP #1990



Sun, 01 Aug 1999 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. VB 5.0 CCE Help!!

2. VB 5.0 CCE

3. DLL loading Problem with VB 5.0 CCE

4. VB 5.0 CCE

5. VB 5.0 CCE

6. How to compile VB 5.0 CCE code.

7. VB 5.0 CCE TextBox Question

8. GDI Function Calls in VB 5.0 CCE

9. How to use a file on the server with VB 5.0 CCE

10. VB CCE/5.0 Enterprise Help

11. How to use a file on the server with VB 5.0 CCE

12. VB CCE/5.0 Enterprise Help

 

 
Powered by phpBB® Forum Software