I want to implement copy, cut and paste in my drawing program (copy part of an image that is selected)
I don't know how to start
Any Ideas?
I want to implement copy, cut and paste in my drawing program (copy part of an image that is selected)
I don't know how to start
Any Ideas?
to copy: take the selected rectangle, create a new image of that size, take a copy of the current image and place it on the new rectangle, offset by the topleft of the selected rectangle
in short there are two ways exists
1) your own clipboard 2) system-wide clipboard
in second case use must use standard format for storing your data. read MSDN for more information about windows clipboard
or you can maintain two clipboards - own and system. then in your clipboard you can store specific information for your application and in system cliboard just image
Here are some global points that will drasticly speed up your issues that you'll be facing.
Try to search for reversible line / rubberband. to make selections in the picture. Try to search for LockBits in VB .NET , to create a fast way of reading and writing pixels. Try to learn background thread , and report progress. For per pixel operations that take a long time. Try to make a MDI. With enough status bars to report the status. Try to serialize to xml/binary when saving a project-file to disk (like a psd for example). This could also be handy , for creating a undo function.
see this one...
but for firefox its not working. am also searching for similar one. will post if i get more.