Application Framework > The Bitmap Editor Application > Step 3: Modifying and Saving a Bitmap
 
Step 3: Modifying and Saving a Bitmap
Editing capabilities will now be added to the Bitmap Editor application. The basic editing function needed can change the color of a pixel in the BitmapDocument.
In Rogue Wave® Views, editing is done through the use of interactor objects. Interactor objects can be associated with a view or with a graphic object and can handle events to perform actions on these objects.
In most Document/View applications, modifications to the document are done through their view. The user performs some action on the view, which results in a modification of the document through a command call. Once the command is executed, the document notifies the views so that they can reflect the changes. The commands that are executed on a document are kept in memory to enable Undo/Redo operations.
Implementing pixel edition requires the following steps:
*Defining a subclass of IlvDvCommand that changes the color of a pixel in the BitmapDocument. In particular, the doIt and undo methods will have to be implemented.
*Defining a subclass of IlvInteractor that is associated with the IlvZoomableIcon object. This interactor will handle the user events on BitmapView and call the above command.
*Adding notification on the document views.
*Enabling Undo/Redo with the Application Framework Editor.
BitmapView uses an IlvZoomableIcon object to display the BitmapDocument. In order to edit a pixel of the document, you need to associate an IlvInteractor object that will handle the mouse events and call the appropriate command.

Version 6.2.1
Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.