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

Create a temporary Picture Box 1

Status
Not open for further replies.
Oct 5, 1999
105
GB
I am writing a Function to draw an image on a printer page. To make it general I don't have reference to any forms, controls etc.
e.g. Function starts
Public Function InsertImage(pOutput as Object, pImage as String, pX as double, pY as double, pWidth as double) as Boolean
which will insert image file into the output at (pX,pY) with a specified width (maintaining aspect ratio)

Is it possible to create a PicureBox in memory so I can do LoadPicture from the supplied filename, and then use PaintPicture to insert it into my print.

I can define it e.g.
Dim picPicture as PictureBox
but not sure how to create it - CreateObject?

I could of course Load a temporary form with a PictureBox on it and then unload it afterwards, but that seems a bit clumsy.

I'm sure this must be simple, but can't think how!
 
Thanks strongm.
I hadn't come across StdPicture before, but it works just fine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top