Paste as Selection

Ask for help and post your question on how to use XnView MP.

Moderators: helmut, XnTriq, xnview

User avatar
xnview
Author of XnView
Posts: 46603
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Paste as Selection

Post by xnview »

do you think that paste need to use default size of image instead to adapt to selection?
Pierre.
cday
XnThusiast
Posts: 4425
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Paste as Selection

Post by cday »

xnview wrote: Mon Jul 25, 2022 12:31 pm do you think that paste need to use default size of image instead to adapt to selection?
I think that would probably be better, but the problem has two parts:

1. To paste the clipboard image at its existing dimensions;

2. To be able to easily place the pasted image at any desired position on the canvas.

That would be the usual case, but possibly there might also sometimes be a need to paste into a resized selection. Helmut?

I am not familiar with the Photoshop and Paintshop Pro interface, but it seems to be a well-established and intuitive way to implement the main need, would it be difficult to implement?
User avatar
helmut
Posts: 8704
Joined: Sun Oct 12, 2003 6:47 pm
Location: Frankfurt, Germany

Re: Paste as Selection

Post by helmut »

I think both use cases should be supported by XnView:
If user has selected an area and then pastes, the contents of the clipboard are pasted into that selection (current behaviour).

If user hasn't selected an area and then pastes, the contents of the clipboard are pasted in original size and ratio at 0,0 position and pasted contents (selection) can be moved and resized (new behaviour).
irhorwood
Posts: 13
Joined: Wed Jul 20, 2022 7:59 am

Re: Paste as Selection

Post by irhorwood »

In PSP, using 'paste as selection' into the new image, the copied clipboard content is placed at it's original dimensions at dead centre of new image. It retains a selection marquee around it and can be re-positioned at will using drag and drop, then a right click whilst in selection tool pastes it at the desired location.
Nicko Bellick
Posts: 1
Joined: Fri Jul 22, 2022 2:42 pm

Re: Paste as Selection

Post by Nicko Bellick »

Hi guys! I had the same issue. Very happy to find the solution here. Thanks a lot!
User avatar
user0
XnThusiast
Posts: 2501
Joined: Sat May 09, 2015 9:37 am

Re: Paste as Selection

Post by user0 »

Last edited by user0 on Tue Sep 02, 2025 3:50 pm, edited 1 time in total.
qsdnlj
Posts: 12
Joined: Sat Jan 28, 2012 2:28 am

Re: Paste as Selection

Post by qsdnlj »

Hi, have there been any updates on this problem? I'd like what I have on my clipboard to be pasted to an image of the same dimensions, especially if the existing image being pasted to has smaller dimensions. (This is the sort of behavior I think we're all used to from dealing with basic programs like Microsoft Paint.)
qsdnlj
Posts: 12
Joined: Sat Jan 28, 2012 2:28 am

Re: Paste as Selection

Post by qsdnlj »

I'm just following up on this problem. Have there been any updates or solutions? Thanks!
qsdnlj
Posts: 12
Joined: Sat Jan 28, 2012 2:28 am

Re: Paste as Selection

Post by qsdnlj »

Just trying again to follow up on this.
jkm
Posts: 77
Joined: Sat May 11, 2024 12:43 am

Re: Paste as Selection

Post by jkm »

There's a "Paste as new image" option, which will place the clipboard contents into a new image.
For pasting into an existing image, I don't think it does what you want.

You're supposed to be able to make a selection first, and then paste and the clipboard contents will be placed inside the selection box (and Pierre mentioned an INI file directive to maintain aspect ratio.)

However, this seems to not work as you want in 1.9.3. You can make the selection and the paste, and the clipboard contents are inserted in the existing image and the selection box is maintained, but although you can then reposition the selection box, doing so does not move the pixels you just pasted in.

Irfanview and PMview do exactly what you want, but XnViewMP can't at this time.
qsdnlj
Posts: 12
Joined: Sat Jan 28, 2012 2:28 am

Re: Paste as Selection

Post by qsdnlj »

Thanks for your help:
  • I tried to use the "Paste as new image" option (Ctrl-Shift-V), but it takes me out of Fullscreen and leaves me unable to save the new image with the original date/time attributes.
  • I'm not sure what you mean by "will be placed inside the selection box". If I have a large 800x800 image Ctrl-C copied into my clipboard, and I Ctrl-V paste it while I am Fullscreen viewing a small 400x400 image, I'm unaware of anything like a "selection box" that the larger image will be placed in. Instead, the pasting makes me see the top-left quadrant of the larger image rather than seeing the entire image.
  • I'm not sure if you're saying that the "INI file directive" enables the desired behavior. Does it, or am I misunderstanding you?
jkm
Posts: 77
Joined: Sat May 11, 2024 12:43 am

Re: Paste as Selection

Post by jkm »

I'm not sure what I can tell you... I can only try and answer what you actually asked based on what you actually said.
qsdnlj wrote: Sun Aug 31, 2025 11:12 pm Thanks for your help:
  • I tried to use the "Paste as new image" option (Ctrl-Shift-V), but it takes me out of Fullscreen and leaves me unable to save the new image with the original date/time attributes.
Fullscreen, and preserving date/time attributes are mentioned nowhere in your post, so I'm surprised you're raising it as a problem.

If you decide to edit an image by pasting new content in, expect filesystem attributes to be modified. Paste as "New Image" implies you're creating a new image file. If you create a new image file, it will have the current time and date.

Furthermore, what date/time attributes are you talking about? Filesystem, I covered above. If you are talking about EXIF information, like {Date Taken}, no application is going to paste in the {Date Taken} metadata. Some applications MIGHT preserve existing metadata from the file you pasted into when you save the file.
qsdnlj wrote: Sun Aug 31, 2025 11:12 pm
  • I'm not sure what you mean by "will be placed inside the selection box". If I have a large 800x800 image Ctrl-C copied into my clipboard, and I Ctrl-V paste it while I am Fullscreen viewing a small 400x400 image, I'm unaware of anything like a "selection box" that the larger image will be placed in. Instead, the pasting makes me see the top-left quadrant of the larger image rather than seeing the entire image.
I think that's a somewhat absurd example, but ok. If you paste 800x800 into a 400x400 image, it's not going to fit. I'm not sure what you expect. If you want to fit something big into something small, first resize the big thing to make it smaller. So it will fit.

But the selection box can help with this.

If you’ve never heard the term “selection box” you might have heard the term “marquee”. Photoshop and some other programs have what they call a “marquee tool” to make selections. Do you know how to make a selection inside an image in the XnViewMP viewer? Just like if you're coping a portion of an image to the clipboard? Based on what you said, I'm guessing not. It is the same as in any other program like Paint. Use the mouse and click-drag a box on the image, just like selecting in any other program. The box you see created is the selection box.

If you Ctrl-V paste when a selection box is visible on the image, your pasted content will be placed inside the box. It will be also be resized if necessary to fit inside the box. If your selection box is not the same aspect ratio as the image data on the clipboard, then by default the content will also be distorted to fit shape of your selection box. (refer to INI file directive) If you don't understand what I'm saying, try it. Try it with your 800x800->400x400 example above too.

If dragging with the left mouse button doesn't create a selection box, check your settings. Go to Settings->Interface->Mouse. You need one of the options for either Left Button or RIght button (perhaps with one of the modifier keys) to be "Make Selection". Learn the setting and use it to make a selection. If Make Selection is not shown on that option screen, you will not be able to make any selection boxes until you fix your options.

The ini file directive referred to preserves aspect ratio during such a paste. If you don't know what "aspect ratio" means, google it. It refers to not distorting your image by stretching or squishing it in any direction.

I assume you read earlier posts in the thread. Other options were mentioned if you don't want the content pasted in the top left corner: resize the destination image first, or use any of the "Paste Outside" options on the edit menu. Or of course the selection box.

So to be very, very explicit about how to use the selection box when pasting:
1. In your source image, copy what you want onto the clipboard.
2. Go to your destination image in XnViewMP, where you want to paste the content
3. Draw a selection box in that destination image, exactly where you want the content to be placed
4. Hit Ctrl-V, and it will paste the content in the box.
5. Hit Escape to remove the now useless box, as it cannot be moved or resized.

I hope that makes sense.
qsdnlj wrote: Sun Aug 31, 2025 11:12 pm
  • I'm not sure if you're saying that the "INI file directive" enables the desired behavior. Does it, or am I misunderstanding you?
I don't know either. You will have to try. Your original post is worded in such a way that I cannot make heads or tails of what your "desired behavior" actually is.

You said "'I'd like what I have on my clipboard to be pasted to an image of the same dimensions, especially if the existing image being pasted to has smaller dimensions." Huh?

"Image of the same dimensions" as what? As the source image? As the clipboard? As the destination image? Then saying if the existing image has smaller dimensions seems directly self-contradictory. Or are you saying dimensions when you actually mean proportions? Are you claiming to desire "same dimensions" but you actually want content resized to fit, which necessitates DIFFERENT dimensions? I have no idea what you actually mean. So you have not made yourself clear at all I'm afraid.

The INI file directive does exactly one thing: when pasting, it prevents distortion (stretching or squishing) when resizing content. I don't know if that helps meet your needs.

My point about the selection box was that although it allows you to position the pasted portion anywhere in the destination image you like, and at any size you'd like, it does NOT allow you to move it once it's been pasted. So you have to create your selection box first, in exactly the right place, and then paste. You cannot move the pasted portion afterwards, as you can in other software such as I mentioned.

Previous posters in the thread asked about moving the pasted content once it had been pasted. Since you were asking for "updates on this problem", I guessed that might be part of your desired behavior. As I and others said before, XnViewMP can't do that; it's a shortcoming. If you have to move the content after you paste, find another program.

So if all you want to do is paste something big into something small, or paste something in at a particular location in the image, then using a selection box when you paste will do that for you.

If you want to paste outside the boundaries of the destination image (the one you're pasting into), you must either do a canvas resize on that image before pasting, or you must use one of the "Paste Outside" options.

That's all there is. You'll need to try these things out to see if they're enough for you. I've tried to help you as best I can.
Post Reply