Jump to content

BUG: Copy & Paste problem


Recommended Posts

I'm using a Windows7 x64 PC and VmWare Workstation to play a Xp machine.

Inside XP I copy an image (just print screen with Stamp button) but It's impossible to paste inside Paint.net on the Windows 7 host.

The error I receive is: "The image in the clipboard couldn't be recognized. Try re-copying it with the original application that was used to acquire it"

I've to paste the image in the standard mspaint.exe of Windows7 re-copy and paste into Paint.Net to use the image.

Thanks.

Sculason

Link to comment
Share on other sites

The clipboard is a shared resource, according to Rick it is "cantankerous". On top of that you're setup is not exactly a standard one.

Please confirm that this problem persists after a reboot before we go any further.

Link to comment
Share on other sites

There are some situations where the clipboard is completely blocked, too.

For instance, if you use Office and have any IRM'd (Information Rights Management) documents or e-mails open, then Office blocks access to the clipboard. That way you can't take a screenshot or do any copy+paste stuff.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

  • 1 month later...

I confirm the problem. It persists after a reboot.

Best regards.

The clipboard is a shared resource, according to Rick it is "cantankerous". On top of that you're setup is not exactly a standard one.

Please confirm that this problem persists after a reboot before we go any further.

Link to comment
Share on other sites

  • 1 month later...

The problem likely exists with VMWare.

Pasting into xp paint, wordpad and word works, xp clipboard viewer (clipbrd.exe) shows the correct image, but pasting to paint.net fails.

To repro:

1) VMware 7.1.2.301548 running on xp sp3

2) xp sp3 vm with latest tools

3) alt-print screen a window from the vm

4) paste into new image with Paint.Net 3.5.5

Link to comment
Share on other sites

  • 1 month later...

If you copy an image from Firefox, e.g. right click on any image and select Paste, then it only puts a CF_DIB on the clipboard. Paint.NET handles pasting this just fine. So, I do not know how to reproduce your specific issue with VMWare.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

This is looking like a framework problem. I debugged IDataObject.GetData; in System.Windows.Forms.DataObject.OleConvertor.GetDataFromOleOther, on line 1508 of DataObject.cs, the COM interop call "innerData.GetData(ref formatetc, out medium);" throws an OutOfMemoryException. Native apps, including vb6 don't have any issues.

Here is a test app that takes paint.net out of the equation

class Program
{
[sTAThread]
static void Main(string[] args)
{
	do
		Console.WriteLine(Paste());
	while (Console.ReadKey(true).Key != ConsoleKey.Escape);
}

private static string Paste()
{
	IDataObject data = Clipboard.GetDataObject();
	if (data == null) return "null GetDataObject";
	if (!data.GetDataPresent(DataFormats.Bitmap, true)) return "not GetDataPresent";
	Image img = data.GetData(DataFormats.Bitmap, true) as Image;
	if (img == null) return "null GetData";
	return "OK";
}
}

I found that the very first call to Paste() after copy is done in VMware, succeeds, but all subsequent ones, fail ("null GetData").

In paint.net, the same thing happens, I can actually get it to paste the first time after copy, using Edit->Paste. It turns out that "Edit->Paste Into New Image" calls GetData twice, once in PasteInToNewImageAction, which is discarded, and again in PasteAction. The second call always fails and so "Paste Into New Image" never works. So I think there is a workaround, pending the resolution of the larger problem. Can you refactor PasteInToNewImageAction and PasteAction so that GetData only gets called once between them?

Since you're in Microsoft, perhaps you get the framework team to look at this, someone surely has VMware.

Edited by laxeraend
Link to comment
Share on other sites

What if you put the following at the beginning of your Paste() method,

GC.Collect();
GC.WaitForPendingFinalizers();
GC.Collect();
GC.WaitForPendingFinalizers();

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

  • 6 months later...

I'm using a Windows7 x64 PC and VmWare Workstation to play a Xp machine.

Inside XP I copy an image (just print screen with Stamp button) but It's impossible to paste inside Paint.net on the Windows 7 host.

The error I receive is: "The image in the clipboard couldn't be recognized. Try re-copying it with the original application that was used to acquire it"

I've to paste the image in the standard mspaint.exe of Windows7 re-copy and paste into Paint.Net to use the image.

Thanks.

Sculason

I get same behavior copying from MSIE in a VMWare VM. Reboots do not fix it.

Host machine:

* Dell Latitude E6510 running Windows 7 Enterprise 64 bit

* VMWare Workstation 7.1.3 build-324285

* Hosted VM is Windows server 2003 SP2

* Application in VM is MSIE 8

I select MSIE window in hosted VM

CTRL-Fn-F11 (capture current window)

Switch to Paint.net ( v3.5.8 Final Release build 3.58.4081.24580 ) in Win7 host

Create new file with CTRL-N. The correct size file is created.

Paste with CTRL-V. This gives the message "The clipboard does not contain an image".

Workaround:

Leave new blank file open in Paint.net

Switch back to hosted app & re-copy same image with same keystroke sequence.

Switch back to Paint.net and paste with CTRL-V. This pastes image.

Alternate workaround:

In hosted VM CTRL-Fn-F11

Switch to PAINT in Win7 host

Paste with CTRL-V { NOTE: If I wasn't a paint.net junkie I'd stop here ;-) }

Copy with CTRL-C

Switch to Paint.net

Create new file with CTRL-N then paste with CTRL-V.

Link to comment
Share on other sites

Hi mnemotronic, welcome to the forum.

Thank you for posting your workarounds.

We have a rule about replying to threads that are older than three months (Rule #11. This one is seven months old. So it's dead and buried.

Please take the time to read through the forum rules. They are considered compulsory reading for all forum users.

Thanks.

<locked>

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...