Jump to content
  • Advertisement
Sign in to follow this  
kingpinzs

How to copy image

This topic is 4848 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

So far I am able to blt a bitmap to the screen and move it anywere on the screen and leave it there but I have no idea how to click on a bit map make a copy that stays with the cursor position. So the real issue is How to copy a bitmap to my cursor position. then I can just blt it to the new position. [Edited by - kingpinzs on August 5, 2005 9:52:21 PM]

Share this post


Link to post
Share on other sites
Advertisement
right now I am trying to use a vector but it is not working very well.

any ideas on how to make a copy of a DirectDraw surface or how to make a copy of a bitmap

Share this post


Link to post
Share on other sites
Hi there kingpinzs,
How are you doing?


[The Problem]
The problem here is that you want the world space coordinates for the mouse cursor.

[The Solution]
The mouse cursor position is now defined in screen space (your monitor space) and what you do is use an inverse ViewProjection Matrix to get to world space. You then check if the coordinates of the bitmap is the same as the mouse and then copy it. You can do this transformation each frame if you want to keep the bitmap following the mouse.


I hope this hels a bit.
Keep cool and take care.

Share this post


Link to post
Share on other sites
That helps a little. I think what I really need to know is how to make a copy of the image.

Problem:
To slect my tiles and place them on the screen.

solution:
click on the tile and have it make a copy of itself"dont know how to do that part" then click on the map and attached the image to that postion then recored the tile id and postion to a text file"dont know how to do that either"

but your info did help me figure out some things. thanks

Share this post


Link to post
Share on other sites
This seems like a general programming question... there is no 'copy', each frame you should draw everything from scratch. So to 'copy' a bitmap you just draw it 2+ times per frame based on whatever internal map structure you have.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!