Powerpoint can't paste bitmap from clipboard

S

skaushik

My application places a bitmap onto the clipboard using
SetClipboardData. The bitmap is copied in both the CF_BITMAP and CF_DIB
formats, and it can be pasted into Microsoft Paint, Wordpad, and pretty
much any other application. However, it cannot be pasted into
Powerpoint.

Does Powerpoint not recognize the plain old bitmap format on the
clipboard? Is there some other format that I should copy the bitmap to
the clipboard as?

Thanks,

-K
 
S

Steve Rindsberg

My application places a bitmap onto the clipboard using
SetClipboardData. The bitmap is copied in both the CF_BITMAP and CF_DIB
formats, and it can be pasted into Microsoft Paint, Wordpad, and pretty
much any other application. However, it cannot be pasted into
Powerpoint.

How are you doing this, what do you expect to happen, what's happening instead,
and in what version of PPT?
Does Powerpoint not recognize the plain old bitmap format on the
clipboard?

It does. Press Alt+PrtScrn, switch to PPT and choose Edit, Paste Special.
That'll show you a list of the clipboard formats PPT recognizes as "pasteable".

DIB and Bitmap will almost certainly be on the list.

Try the same thing after your application puts an image on the clipboard. Are
they still there?
Is there some other format that I should copy the bitmap to
the clipboard as?

There should be no need for that.
 
K

Kaushik Sridharan

Okay, I have some more insight on the problem.

My application copies the bitmap to the clipboard in three formats:
CF_DIB, CF_BITMAP and CF_HTML. In the HTML case, there's just some text
and a link to a locally saved copy of the bitmap.

Powerpoint can paste the image if I only place the CF_DIB and CF_BITMAP
formats on the clipboard. It cannot paste it if I also include the
CF_HTML format. However, I can paste it if I select Paste Special and
then choose one of the bitmap formats.

Apparently, Powerpoint cannot paste the the HTML format that's placed
in the clipboard. Furthermore, it tries to paste the HTML format (and
fails) even though the bitmap formats are also available. I tried this
on Powerpoint 2003 SP1, by the way.

The workaround is to always chose Paste Special, but I'd prefer if just
Paste also were to work. Any ideas?

-K
 
S

Steve Rindsberg

Okay, I have some more insight on the problem.

My application copies the bitmap to the clipboard in three formats:
CF_DIB, CF_BITMAP and CF_HTML. In the HTML case, there's just some text
and a link to a locally saved copy of the bitmap.

Powerpoint can paste the image if I only place the CF_DIB and CF_BITMAP
formats on the clipboard. It cannot paste it if I also include the
CF_HTML format. However, I can paste it if I select Paste Special and
then choose one of the bitmap formats.

Good info ... thanks.

Apps can choose which of the various clipboard formats they want to use by default.
Apparently given the choice of DIB/Bitmap or HTML, PPT likes the HTML but expects
different info from what your app supplies. Since you can't change PPT, you may
have to have your app pop only the bitmap formats up there.
 
S

skaushik

Yeah, that seems to be the problem. It is unfortunate that Powerpoint
does not try the bitmap formats when the HTML paste fails. Also, the
order in which the formats are placed on the clipboard seem to have no
bearing on the priority used by Powerpoint.

Thanks for your response. This is the app I am talking about btw:

http://bhelpuri.net/Snippy/

-K
 
S

Steve Rindsberg

Yeah, that seems to be the problem. It is unfortunate that Powerpoint
does not try the bitmap formats when the HTML paste fails. Also, the
order in which the formats are placed on the clipboard seem to have no
bearing on the priority used by Powerpoint.

Nope, that's not how it works. It's left to each app to decide what clipboard formats
it wants to favor and in what order.
Thanks for your response. This is the app I am talking about btw:

http://bhelpuri.net/Snippy/

Looks like a cute little app. Have you considered doing some screenshots and such for
Trixie? The descriptions may make sense to someone who uses the comparable features in
Firefox but otherwise ... sitting there scratching my head.
 

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