[Edit] Ignore this post. While I was typing, you cleared a few things up which render my post void. What I thought you were doing is nothing like what you are actually doing!
Quote: "Yea I meant more like the right side of the Image will be at the right side of the screen and the top of the Image on position Y=0"
Ah OK - I understand now.
So to clarify:
The user sees this big image with lots of smaller images on it and
he selects the house right? When he moves the mouse cursor over one of the 16 smaller images, a pop-up previews it.
You said you were getting black images - which means your Get Image rectangle is not set properly or the image isn't on the screen when you try to do the grab.
When you grab the house, you have to remember to add the offset value for X because the image is not at 0 like Y is.
Actually I just checked out your code snippet again and was wondering why you were pasting it as a sprite instead of an image?
There's no problem if it needs to be a sprite - I've just had to solve a similar problem with the Onion-skinning feature in Dark Sprites. You may have the same problem.
Paste Sprite doesn't appear work without a Sync to update the screen after creating the sprite and before pasting. But, if you don't actually need it to be a sprite, using Paste Image is preferable - and then the problem no longer exists.
It looks like your big image is a 4x4 grid of 16x16 images so I don't follow why you are grabbing the whole 64x64 rectangle when the mouse button is clicked.
Actually the whole snippet isn't making sense, as without the rest of the program, I'm probably reading it out of context. Especially the
If MouseX() line which is just plain weird!
A such, this post is rapidly turning into a ramble. I just hope you can make some sense out of it when I've finished!
You are creating the sprite then pasting the sprite in the same place, but you aren't deleting it - so it's still there on top of the pasted version.
So, in a nutshell, assuming you are trying to do what I think you are, you are making it overly complicated. All you need to do is calculate the top left and bottom right corner's X and Y of the big image and deduct the top left X from the mouse's current X screen position.
If you divide this by the tile's X size and divide the mouse Y position by the tile's Y size you get the current column and row on the grid that the mouse is over.
GridY*4+GridX+1 (if I remember correctly) then gives you the image number to preview.
Finally, I noticed that you are starting some variable names with an underscore. I don't think this is a good idea, though a lot of people do it.
Starting labels with underscores is fine, but with variables you get confusing things like this line from your snippet:
for y=0 to _y
When I read it on here, I saw:
for y=0 to y
because the underscore merged with the line below. That threw me for a few minutes. Far too confusing for me lol!
TDK