Weird problem with Clip Organizer cut-and-past

Q

queisser

Hi all,

I'm writing a C# app that uses copy/paste to put graphics in a window.
My copy/paste logic first looks for Metafile, then for bitmap.

Here's the problem: when I copy and paste a WMF clip from the organizer
(in Word or standalone) into my app I get a nice high-res image the
first time I copy a particular clip. The second time I get a very
low-res copy, presumably the same resolution as the thumbnail. In Word
or PowerPoint it works every time.

Here's how you can reproduce it without my app:

1) Open Paint (from Start|All Programs|Accessories)
2) Open Clip Organizer (from Start|All Programs|Microsoft
Office|Microsoft Office Tools|Clip Organizer). You can also use the
Clip Organizer from within one of the Office programs with the
"Insert|Picture|Clip Art" menu.
3) Select a clip from Clip Organizer that has WMF format
4) Right-click on the clip or click on the arrow on the right side of
the clip
5) Select "Copy"
6) Paste the clip into Paint
7) Select a different WMF format clip and repeat steps 3-6
8) Select the same clip as in step 2) and repeat steps 3-6

Now on my machine (Windows XP SP2 on HP laptop) I get a low-res bitmap
on all but the first selections of a WMF clip. Other Office products
don't have this problem so they must paste the underlying file
automatically instead of pasting the Metafile.

Any ideas why this is happening?

Thanks,
Andrew Queisser
 
M

Mary Sauer

If you click new from file, the second paste will be the same as the first. I only
could duplicate your issue once, all other times the .wmf would paste on top of the
first. If you open the Clipboard, view, and select enhanced metafile it should paste
correctly.
 
D

Danny Tuppeny

Mary Sauer said:
I only could duplicate your issue once, all other times the .wmf would
paste on top of the first.

I tried it here, and the second time I pasted any image, it pasted wrong.
eg. paste Image1, works fine. paste Image2, works fine. Paste Image1 again,
it's wrong. Paste Image3, it's right. 100% predictable and reproducable
here!

I've no idea what's causing it, but it's certainly weird!
 
M

Mary Sauer

I believe it has something to do with pasting on the same canvas. If you go to file,
new, the paste is correct.
 
Q

queisser

I did a little more testing and it turns out that the clip organizer
truly generates two different Metafiles. The first time it's high-res,
second and subsequent times it's low-res. You can verify that in any
Office program with "Paste Special" and selecting "Metafile" (or maybe
"Enhanced Metafile", I can't remember.)

I changed my app to always prefer creating the Metafile from the
underlying disk file, which is what the other Office apps apparently
do. I imagine the MS folks only tested the clip organizer with other
Office products so this bug wasn't noticed.

Andrew
 
D

Danny Tuppeny

Mary Sauer said:
I believe it has something to do with pasting on the same canvas. If you go
to file, new, the paste is correct.

Not here it's not. Besides, I was pasting on the same canvas every time, but
when it's an image I've not pasted before, it was the right size! Definately
a copy thing!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top