Copy, cut and paste implementation

I want to implement copy, cut and paste into my paint program (copy part of selected image)

I don't know how to start

Any ideas?

+1


a source to share


5 answers


  • Use the system-wide clipboard , in case the user copies an application in one instance and pastes it into another, or if the user closes the window and reopens it, they can paste back the data.
  • Inherit all forms of a program from a base class that implements copy and paste.
  • To copy (or cut), serialize the object and place it on the system clipboard.
  • To paste , read the system clipboard and try de-serializing back to the shape object (if the cast fails, the contents of the clipboard were not your application object).
  • Move the position of the inset shape slightly to the left and bottom (so the user knows that there is a new shape in the picture)


+1


a source


to copy: take the selected rectangle, create a new image of this size, take a copy of the current image and place it on a new rectangle, offset to the top of the selected rectangle



0


a source


in short, there are two ways

1) own clipboard 2) system-wide clipboard

in the second case, the use is to use a standard format for storing your data. read MSDN for more information on Windows Clipboard

or you can maintain two clipboards - your own and the system one. then in your clipboard you can store certain information for your application and in the system click only the image

0


a source


Here are some global dots that will dramatically accelerate the problems you face.

Try to find a reversible line / rubber band. to make a selection in the picture. Try searching for LockBits in VB.NET to create a quick way to read and write pixels. Try to examine the background thread and report progress. For pixel operations that take a long time. Try to do MDI. With enough status bars to communicate status. Try serializing to xml / binary when saving the project file to disk (like psd). It can also be useful for creating an undo function.

0


a source


see this ...

http://www.wallpaperama.com/forums/javascript-copy-selected-text-box-select-all-highlight-text-form-copy-paste-t706.html

but for firefox it doesn't work. I am also looking for a similar one. will post if i get more.

0


a source







All Articles