Copy form graphics to Clipboard Question 
Author Message
 Copy form graphics to Clipboard Question

Trying to copy a region of a form's graphics to the clipboard and running
into problems.

I'm doing the following:
1. placing a series of lines on a form using the win32 api and vb functions
2. try to copy these lines to the clipboard by
        - using win api bitblt function to copy region of form to a picture
box control
        - using clipboard.setdata [pbcontrol].picture

First part seems to work since the form graphics appear in the picturebox
control after the bitblt, however, the graphics do not go to the clipboard
with the setdata command.

Thanks,

Jonathan



Sat, 04 Aug 2001 03:00:00 GMT  
 Copy form graphics to Clipboard Question
All,

Figured this out ...

Had to do following ...

1. set the autodraw property of the picturebox control to true
2. after bitblt from the form to the picturebox control, had to set picture
property equal to the image property in the picturebox control.  I guess
that bitblt copies bitmap to the image property.
3. had to resize the picturebox control using the width and height
properties before performing the bitblt, otherwise, resulting image was
clipped, even though the autosize property was set to true in the picturebox
control

Hope this helps ...

Quote:
>Trying to copy a region of a form's graphics to the clipboard and running
>into problems.

>I'm doing the following:
>1. placing a series of lines on a form using the win32 api and vb functions
>2. try to copy these lines to the clipboard by
>        - using win api bitblt function to copy region of form to a picture
>box control
>        - using clipboard.setdata [pbcontrol].picture

>First part seems to work since the form graphics appear in the picturebox
>control after the bitblt, however, the graphics do not go to the clipboard
>with the setdata command.

>Thanks,

>Jonathan



Sun, 05 Aug 2001 03:00:00 GMT  
 Copy form graphics to Clipboard Question
I have been working on this question for a while... without finding the
solution !

Can you please give us the code used to do that... it would be *really*
useful to me !

Thanks in advance,

Ronan

PS : thanks for sending it also directly to me...

Jonathan Harwood a crit dans le message

Quote:
>All,

>Figured this out ...

>Had to do following ...

>1. set the autodraw property of the picturebox control to true
>2. after bitblt from the form to the picturebox control, had to set picture
>property equal to the image property in the picturebox control.  I guess
>that bitblt copies bitmap to the image property.
>3. had to resize the picturebox control using the width and height
>properties before performing the bitblt, otherwise, resulting image was
>clipped, even though the autosize property was set to true in the
picturebox
>control

>Hope this helps ...



Sun, 05 Aug 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Copying DBGrid contents to clipboard (Or copying a table from a Data component to clipboard)

2. Network Diagram: Copy one task box graphic to clipboard

3. InlineShape bug? - graphics spoilt when copied to clipboard

4. How do I copy graphics into the clipboard?

5. How to copy graphics to clipboard?

6. Copying graphics to clipboard as metafile

7. copying runtime graphics into clipboard

8. copy to clipboard(form)

9. Easy Question: Copy to Clipboard ....

10. Copy text from VBA form to Clipboard

11. Copying form field contents & formatting to clipboard

12. vb.net windows forms ... copy from clipboard

 

 
Powered by phpBB® Forum Software