Home All Groups Group Topic Archive Search About

Print contents of picturebox

Author
2 Sep 2006 1:49 PM
Christie
In my application, lines (shapes such as circles) and text are drawn in
a picturebox.  I am struggling to find a way to print the text and
shapes.  There is no images in the picturebox.  Could someone please
show me the way.

I am using Visual Studio 2005 (VB.Net)
Operating System: XP Pro

Thanks

Author
4 Sep 2006 6:22 PM
Mike McIntyre
If you are drawing to a PictureBox as you state, you can access the
PictureBox's image via its Image property:

Dim theImage As Image = PictureBox1.Image

--
Mike

Mike McIntyre [MVP]
http://www.getdotnetcode.com


Show quoteHide quote
"Christie" <c.mybu***@yahoo.com> wrote in message
news:1157204995.295816.19590@m79g2000cwm.googlegroups.com...
> In my application, lines (shapes such as circles) and text are drawn in
> a picturebox.  I am struggling to find a way to print the text and
> shapes.  There is no images in the picturebox.  Could someone please
> show me the way.
>
> I am using Visual Studio 2005 (VB.Net)
> Operating System: XP Pro
>
> Thanks
>
Author
4 Sep 2006 7:59 PM
Herfried K. Wagner [MVP]
"Mike McIntyre" <mik***@getdotnetcode.com> schrieb:
> If you are drawing to a PictureBox as you state, you can access the
> PictureBox's image via its Image property:
>
> Dim theImage As Image = PictureBox1.Image

This will only work if you assigned the image to the picturebox previously,
but it will fail if you painted onto the picturebox in its 'Paint' event
handler, for example.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://dotnet.mvps.org/dotnet/faqs/>