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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Picturebox and PaintPicture 2

Status
Not open for further replies.

waytech2003

Programmer
Jul 14, 2003
316
US
I have a Picturebox that has a picture (jpg), and a Shape control loaded at design time. My program moves the Shape control around on the picture at runtime. The Picturebox has Autoredraw set to True. (tried False also)

I want to print the picture as seen on the screen, and use the following.

Printer.PaintPicture Pic1.Picture, 1, 1, Pic1.Scalewidth, Pic1.ScaleHeight

All I get is the original picture and no Shape control.

I have tried using Pic1.Image and no difference.

Also have tried Pic1.Picture=Pic1.Image and still no luck.

I tried placing a second picturebox on the form and using Pic2.Picture=Pic1.Picture and Pic2.Picture=Pic1.Image. The second picture only gets the original Picture, No Shape control.

How do I get what I see in the Pic1 to another Object?

Wayne

 
Okay, see this thread... thread222-516967 and DrJavaJoe's first post. I believe it has all the code you will need...



Good Luck

 
I believe the Shape control will be a simple shape, perhaps a circle or square, highlighting some object on the picture.

If, instead of using the shape control, you draw the shape using picture box drawing methods (Line, Circle etc.), you will be able to grab that shape overlaid on the picture using Image property.
 
vb5prgrmr
That works great. Here's your star...

Hypetia
Yes your idea works too. [thumbsup]
My shape is just a simple rectangle and I can Draw that just before I print.

Was just thinking I was doing something wrong, but I see there is no built in method to integrate a control into the picture.

Thanks both for your help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top