This section provides information about the following:
Creating a Mark via Function Calls
ART marks are created by using their constructors. For example, a rectangle mark can be created as follows:
Java Example |
Copy Code |
ImGearRGBQuad igRGBQuad = new ImGearRGBQuad(255, 0, 0);
ImGearRectangle igRectangle = new ImGearRectangle(0, 0, 100, 100);
ImGearARTRectangle igARTRectangle = new ImGearARTRectangle(igRectangle, igRGBQuad); |
Once it is created, it should be added to the ART page:
Java Example |
Copy Code |
int markID;
ImGearARTPage igARTPage = new ImGearARTPage();
markID = igARTPage.AddMark(igARTRectangle, ImGearARTCoordinatesType.IMAGE_COORD); |
Mark attributes can be edited at any time:
Java Example |
Copy Code |
// Get the mark we just added.
igARTRectangle = (ImGearARTRectangle)igARTPage.MarkGet(markID);
igARTRectangle.setOpacity(128); |
Saving ART Marks
Once your application has created some marks, they may want to save them somewhere. Your application has the following choices of where to save them:
- Save them to a separate .ART file. This is a legacy ART storage format supported in old versions of ImageGear for .NET and ImageGear Professional. Using this method, your application will have to keep track of which .ART file goes with which image file, and load them together. Use ImGearART.SavePage methods with ImGearARTSaveType.LEGACY parameter to do this.
- Save them to a separate .XML file. This is a more flexible and extendable storage format highly recommended for using. Using this method, your application will have to keep track of which .XML file goes with which image file, and load them together. Use ImGearART.SavePage methods with ImGearARTSaveType.XML parameter to do this.
- Save the ART marks as tags or objects inside the image file. This option is only available for the raster file formats that support storing annotations, like TIFF files. Use the ImGearART.SavePage method that takes an ImGearPage object to do this.
- Save the ART marks as annotations inside the PDF file. This option is only available for PDF format. Use the ImGearART.SavePage method that takes an ImGearPage object to do this.
- "Burn In" the ART marks. This converts the ART marks from their native representation to the format of the raster image file. This method usually destroys a lot of their functionality (for instance, once a mark is burned in to a JPEG image, it cannot be moved, resized or hidden). Use the ImGearART.BurnIn method to do this.
|
.ART files can be read by any other application developed with ImageGear. |
Loading ART Marks
Once ART marks have been saved, they can be reloaded (by the same user or a different user, using the same program or using any other ImageGear-enabled application). The way that the marks were saved will determine how they must be reloaded:
- .ART / .XML / image file / PDF file : Your application loads the image using any of the ImGearFileFormats Class Loadxxx methods and then loads ART page using the appropriate ImGearART.LoadPage Method.
- Burned In: Your application loads the image using any of the ImGearFileFormats Class Loadxxx methods. The burned-in remains of the marks are loaded as part of the image.
Deleting Marks
Marks are deleted by using ImGearARTPage.MarkRemove methods or RemoveMarks methods.
|
Marks that are burned-in cannot be deleted. |