ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 possible problem with pasting into image selection
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

jrpcguru

USA
254 Posts

Posted - Apr 24 2019 :  17:58:39  Show Profile  Reply
I just realized that my program was using the deprecated versions of Copy/Cut/Paste, so I decided to update to your current versions. Then I discovered that my program would no longer paste into a selection. I retested an older version of my program and it still pastes into a selection.

So I tried the PhotoEn demo program. It has a paste to selection or Paste to Rect option on the menu. (ActiveMDIChild as TMDIChild).ImageEnView1.Proc.PasteFromClipboard(iecpSelection);

I've also tried in the demo: ImageEnView1.Proc.PasteFromClipboard(iecpSelection,true,true,false); //maintain aspect ratio
ImageEnView1.Proc.PasteFromClipboard(iecpAuto);



With D10.3 and XE2 the demo does not work any more. Is it possible something has gone wrong with pasting to a selection? If it makes any difference, I'm trying to paste an image from win 10 snipping tool, which works if I don't have a selection.

Further update: if the image on the clipboard came from ImageEn, paste to selection works. But not if the image came from the snipping tool.

J.R.

xequte

38196 Posts

Posted - Apr 28 2019 :  17:51:53  Show Profile  Reply
Hi JR

I cannot reproduce that:

1. Make a selection in the PhotoEn demo
2. Copy a window using the Snipping Tool
3. Click a button which calls: ImageEnView1.Proc.PasteFromClipboard(iecpSelection);

It pastes to the selection box as expected. Can you give me more info?

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

jrpcguru

USA
254 Posts

Posted - Apr 28 2019 :  19:42:50  Show Profile  Reply
After more testing, here is some useful info:

If my sample image is a JPG, then I can paste into a selection regardless of whether the source image is an ImageEn selection to clipboard or a Snipping Tool image.

I was using several TIF files as my original sample images and paste to selection failed. Then I realized the sample TIFs were B&W, not color. A color TIF worked correctly. If I use ImageEn to copy a selection from the B&W TIF, it pastes back into a selection as expected. But apparently the Snipping Tool creates a color image, even when snipping from the B&W TIF image, since it does not paste into a selection.

So I guess the question is whether that is the intended behavior? Would it be worth having some useful error message if it can't paste a color image into a selection on a B&W image? Or should it convert to B&W and paste into the selection?

If there is no selection, then the entire B&W TIF is replaced by the color image from the clipboard.

J.R.
Go to Top of Page

xequte

38196 Posts

Posted - Apr 29 2019 :  01:00:44  Show Profile  Reply
You're right. That's a bug. For 8.5.1, it will match the pixel format of the destination.

Email me for updated source.


Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: