Как прожечь аннотации на изображении?
В этом разделе
1. JavaScript API для прожига аннотаций на изображении в HTML5 веб-браузере.
Вот JavaScript код, который показывает, как прожечь аннотации на изображении, сохранить изображение в новый файл и скачать новый файл с сервера:
// create an annotation viewer
var annotationViewer = new Vintasoft.Imaging.Annotation.UI.WebAnnotationViewerJS("WebAnnotationViewer1");
...
// get image that is focused in annotation viewer
var image = annotationViewer.get_FocusedImage();
// if annotation viewer has focused image
if (image != null) {
// get annotation controller that is associated with annotation viewer
var annotationController = annotationViewer.get_AnnotationController();
// burn annotation collection on image and save changed image to a new file
annotationController.burnAnnotationCollection(
image,
false, // specify that changed image must be saved to a new file
__annotationController_burnAnnotationCollection_success,
__annotationController_burnAnnotationCollection_error);
}
/*
* Annotations are successfully burned on image.
*/
function __annotationController_burnAnnotationCollection_success(data, status, e) {
// get information about new image
var newImageInfo = data.imageInfo;
// get identifier (name) of new image file
var newImageId = newImageInfo.fileInfo.id;
// download new image file
Vintasoft.Imaging.VintasoftFileAPI.downloadImageFile(newImageId, __onDownloadFile_success, __onDownloadFile_error);
}
/*
* Annotations are not burned on image.
*/
function __annotationController_burnAnnotationCollection_error(data, status, e) {
alert('Burn annotations error.');
}
/*
* Image file is successfully downloaded from server.
*/
function __onDownloadFile_success(data) {
// get a blob, which contains data of downloading file
var blob = data.blob;
// get name of downloading file
var filename = data.filename;
...
}
/*
* Image file is not downloaded from server.
*/
function __onDownloadFile_error(data) {
alert('File download error.');
}
2. Пользовательский интерфейс веб просмотрщика документов для прожига аннотаций на изображении в HTML5 веб-браузере.
По умолчанию панель инструментов для работы с аннотациями содержит панель "annotationActionsToolbarPanel", которая содержит кнопку "burnAnnotationsButton". Кнопка "BurnAnnotationsButton" прожигает аннотации на изображении, которое является сфокусированным в веб просмотрщике аннотаций.
Вот снимок экрана панели инструментов аннотаций в веб приложении (кнопка "burnAnnotationsButton" отмечена красным прямоугольником):