469,964 Members | 1,788 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,964 developers. It's quick & easy.

Image won't copy to clipboard from picturebox

Hi--

I am using VB.Net 2002 for this app. I am working with Tiff and jpeg
images. I have a picturebox set up that I use to view the images. I
have the picture box inside of a scrollable panel.There are two viewing
preferences available: to view the image with scrollbars (the original
image unsized), and to view the iamge without scrollbars (the image
resized to fit within the panel's viewing range.) When I resize the
image so that the entire image is contained in the picture box (without
scrollbars) then the image copies to the clipboard correctly every
time. But, when I view the image in the picture box so that it has
scroll bars on it, when I copy the image to the clipboard it sometime
works, and sometimes doesn't. If it doens't work, I can't paste the
contents into anything else: When I copy the image to a Word doc, I
get nothing, no errors, no image, nothing. When I copy the image into
Paint, I get an error that tells me that it failed to retreive the data
from the clipboard.
I find that this randomly errors, I can't see any correlation as to
what causes it to NOT work. At times it will work with no problems,
at others I can't copy a thing. The only thing consistent about either
situation, is that for the current session it either always works, or
it never works.

I've tried restarting my machine, sometimes this fixes the problem, but
sometimes it doesn't.

Mycode for copying to the clipboard is this:
System.Windows.Forms.Clipboard.SetDataObject(pbox Viewer.Image)<

For now I have been unable to track this problem down so that I can
correct it. I am unhappy about this. Are there any workarounds so
that I can guarantee that the function will always work correctly? I
wrote this app a while ago, and when I originally did intense testing,
this problem did not exist. I am able to duplicate these results on
multiple machines, so I know that it is not just me. Please let me
know if there are any patches that are available to fix this.

--Thanks,
mhos

Feb 15 '06 #1
0 2162

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by VB User | last post: by
15 posts views Thread by Anand Ganesh | last post: by
6 posts views Thread by anonymous | last post: by
7 posts views Thread by lgbjr | last post: by
5 posts views Thread by exhuma.twn | last post: by
2 posts views Thread by Dominic Vella | last post: by
6 posts views Thread by Jerry Spence1 | last post: by
1 post views Thread by rainxy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.