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

PictureBox Component & Conversions

Status
Not open for further replies.

dodgyone

Technical User
Jan 26, 2001
431
GB
In my app I copy the MSFlexGrid to a PictureBox and in turn I want I want to copy this image into something I can paste into an automatic e-mail.

I've tried the clipboard properties but all I get are reference numbers when I try to copy and paste the PictureBox into the e-mail.

Do I need to convert the PictureBox image to a recognized format and then copy and paste on the clipboard?

Thanks....
 
Do

Picture1.Picture = Picture1.Image

before you copy it to the clipboard.

- Andy.
 
P.S.

Also, when copying to the clipboard do:

Clipboard.SetData Picture1

as opposed to anything like Picture1.hDC or Picture1.hWnd, that may explain why you end up with numbers in the clipboard instead of an image.
 
I Still get only numbers when I copy your examples Andy...

Do you have any idea why?

Thanks,
Marcus
 
OK, try the following as an example:

1. On a blank form, create a picturebox and stick any old picture in it

2. In the Form Load code, do this:

Clipboard.Clear
Clipboard.SetData Picture1

3. Open Windows Paint and do Edit Paste, you should get your picture from VB.

If you don't clear the clipboard before adding your image then that may be the problem.

Assuming the above example works then I can't see why your code won't also work.

- Andy.
 
Sorry, you were right all along... I've been using MAPI to send my e-mails and obviously it doesn't support what I've been wanted to achieve. I've created an image and attached this to the e-mail instead. It seems okay this way... what the heck, as long as it works ;o)

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top