Jump to content


Photo

Possible bug: "The clipboard doesn't contain an image."


11 replies to this topic

#1 Toli

Toli
  • Members
  • 136 posts
  • LocationRomania
  • Reputation:0

Posted 16 September 2010 - 04:20 PM

False. The Clipboard does contain an image. It is a png and it can be safely pasted into Word or Excel using "Paste Special". It can't be pasted in mspaint though.
  • 0

#2 pyrochild

pyrochild
  • Administrators
  • 11,498 posts
  • LocationColorado
  • Reputation:205

Posted 16 September 2010 - 04:42 PM

If it's not working in Paint.NET or MSPaint, but it works in Word and Excel, you might have some Office proprietary data in the clipboard, not a regular bitmap image.

Or maybe you copied the image file instead of the image. This is not the same thing.
  • 0
xZYt6wl.png
ambigram signature by Kemaru

[I write plugins and stuff]

If you like a post, upvote it!

#3 Toli

Toli
  • Members
  • 136 posts
  • LocationRomania
  • Reputation:0

Posted 16 September 2010 - 04:48 PM

It is not the file, it is a png image. I know the difference.
I copy it using .net.
Clipboard.SetData("PNG", image);
image is a standard 32bpp png which opens fine in Paint.NET and renders fine in .net Windows.Forms.
Clipboard.SetImage(image);
does the job, but the image loses its transparency when pasted, so it's of no use.

So, why does Paint.NET not recognize the "PNG" Clipboard format?
  • 0

#4 Ego Eram Reputo

Ego Eram Reputo

    2013 Proton Award Winner

  • Moderators
  • 8,001 posts
  • LocationNorth Canterbury, New Zealand
  • Reputation:673

Posted 16 September 2010 - 10:14 PM

http://forums.getpai...post__p__330306 (just a suggestion)
  • 0

#5 himself22

himself22
  • Members
  • 635 posts
  • Reputation:1

Posted 17 September 2010 - 12:09 AM

EER: Your link doesn't go anywhere.
  • 0

"The truth is just an excuse for having a lack of imagination."

Posted Image


#6 Ego Eram Reputo

Ego Eram Reputo

    2013 Proton Award Winner

  • Moderators
  • 8,001 posts
  • LocationNorth Canterbury, New Zealand
  • Reputation:673

Posted 17 September 2010 - 12:22 AM

How wierd. I used the usual right click on the post number. Odd.

I meant to link to Rick's post in this thread: Clicky
  • 0

#7 Rick Brewster

Rick Brewster

    Paint.NET Author and Developer

  • Administrators
  • 13,612 posts
  • LocationKirkland, WA
  • Reputation:348

Posted 17 September 2010 - 02:55 AM

Actually Paint.NET is intentionally lying to you. I needed a way to get more people to sign up for the forum so I made it randomly bomb out on copy/paste ...

Just kidding. It's not lying to you. Like I said elsewhere, the clipboard is a shared resource, it's cantankerous, and it's not very smart. Setting the type to "PNG" doesn't mean anything, you're using the wrong tag there.
  • 0
The Paint.NET Blog: http://blog.getpaint.net/
Donations are always appreciated! http://www.getpaint.net/donate.html

Posted Image

#8 Toli

Toli
  • Members
  • 136 posts
  • LocationRomania
  • Reputation:0

Posted 17 September 2010 - 05:22 AM

But it actualy is a PNG and Word sees it as a valid PNG... so the tag is not wrong
  • 0

#9 gregdosborne

gregdosborne
  • Newbies
  • 3 posts
  • Reputation:0

Posted 07 July 2011 - 06:12 PM

It is not the file, it is a png image. I know the difference.
I copy it using .net.

Clipboard.SetData("PNG", image);
image is a standard 32bpp png which opens fine in Paint.NET and renders fine in .net Windows.Forms.
Clipboard.SetImage(image);
does the job, but the image loses its transparency when pasted, so it's of no use.

So, why does Paint.NET not recognize the "PNG" Clipboard format?



To properly paste a PNG image to the clipboard, do the following
using (MemoryStream stream = newMemoryStream())

{

_Bitmap.Save(stream,
ImageFormat.Png);

var data = newDataObject("PNG", stream);

Clipboard.Clear();

Clipboard.SetDataObject(data, true);

}


This should take care of your problems.

Edited by gregdosborne, 07 July 2011 - 06:13 PM.

  • 0

#10 Rick Brewster

Rick Brewster

    Paint.NET Author and Developer

  • Administrators
  • 13,612 posts
  • LocationKirkland, WA
  • Reputation:348

Posted 07 July 2011 - 06:35 PM

gregdosborne, newer versions of Paint.NET already do this. Using Reflector, look at PaintDotNet.exe, in the PaintDotNet.ClipboardUtil class, in the GetClipboardImageAsSurface() method.
  • 0
The Paint.NET Blog: http://blog.getpaint.net/
Donations are always appreciated! http://www.getpaint.net/donate.html

Posted Image

#11 pdnnoob

pdnnoob

    2013 Radiance Award Winner

  • Moderators
  • 2,439 posts
  • Reputation:203

Posted 07 July 2011 - 07:37 PM

I kinda feel like a noob saying something that doesn't involve arguing with strings of code, but when I get an error message like that and I can only paste into a word processor, it is usually because I highlighted the image, then copied it. From a non-programmer perspective (and I feel silly saying this), the computer thinks I copied a piece of text and I'm trying to paste it as an image. To solve the problem, I go back, un-highlight the image, and copy by right clicking and pressing the "copy image" button. Not sure if this is the same issue, but it sure sounds like it is.
  • 0
noobsig-1.png
what I do all summer Emote Cursor Pack 'noob gallery
No, Paint.NET is not spyware...but, installing it is an IQ test. ~BoltBait
Blend modes are like the filling in your sandwich. It's the filling that can change your experience of the sandwich. ~Ego Eram Reputo

#12 Rick Brewster

Rick Brewster

    Paint.NET Author and Developer

  • Administrators
  • 13,612 posts
  • LocationKirkland, WA
  • Reputation:348

Posted 08 July 2011 - 04:43 AM

Well this conversation is going on elsewhere and this thread is really old anyway, I'm going to close the thread.
  • 0
The Paint.NET Blog: http://blog.getpaint.net/
Donations are always appreciated! http://www.getpaint.net/donate.html

Posted Image