In This Topic
SDK can open images from the following image and document file formats:
- BMP (Bitmap Picture)
- CUR (Windows Cursor)
- DICOM (Digital Imaging and Communications in Medicine) - VintaSoft DICOM .NET Plug-in is necessary
- DOC (Microsoft Word Binary Format Document) - VintaSoft Office .NET Plug-in is necessary
- DOCX (Microsoft Word Open XML Format Document) - VintaSoft Office .NET Plug-in is necessary
- EMF (Enhanced Metafile)
- GIF (Graphics Interchange Format), animated GIF
- ICO (Windows Icon)
- JBIG2 (Joint Bi-level Image Experts Group), single/multipage - VintaSoft JBIG2 .NET Plug-in is necessary
- JPEG (Joint Photographic Expert Group)
- JPEG-LS (lossless JPEG)
- JPEG2000 - VintaSoft JPEG2000 .NET Plug-in is necessary
- PBM (Portable Bitmap), PGM (Portable Graymap), PPM (Portable Pixmap)
- PCX (PC Exchange)
- PDF (Portable Document Format), PDF/A - VintaSoft PDF .NET Plug-in is necessary
- PNG (Portable Network Graphics)
-
RAW camera image:
- DNG (Digital Negative Specification)
- CR2 (Canon Digital Camera Raw Image Format)
- CRW (Canon Raw CIFF Image File)
- NEF (Nikon Electronic Format)
- NRW (Nikon Raw Image File)
- TGA (Truevision TGA)
- TIFF (Tagged Image File Format), Big TIFF, single/multipage
- WEBP
- WMF (Windows Meta File)
- XLS (Microsoft Excel Binary Format Document) - VintaSoft Office .NET Plug-in is necessary
- XLSX (Microsoft Excel Open XML Format Document) - VintaSoft Office .NET Plug-in is necessary
- XPS (XML Paper Specification) - available in WPF edition only
Open image file stored on server
SDK can open images, which are stored on server.
Here is an example that shows how to clear image collection of web image viewer, load images from TIFF file, which is located on server, and add created images to the image collection:
// identifier of multipage TIFF file, which is located on server
var fileId = "multipage.tif";
// get image collection of image viewer
var images = imageViewer.get_Images();
// clear image collection and add all images from TIFF file to the image collection
images.openFile(fileId);
Here is an example that shows how to load images from TIFF file, which is located on server, and add created images to the image collection of web image viewer:
// File is opened successfully. This function is obligatory because without this function the image collection will be cleared.
function __openFile_success(data) {
// an array of WebImageJS objects, which represent images from opened TIFF file
var newImages = data.images;
// add images to the end of image collection
images.addRange(newImages);
}
// identifier of multipage TIFF file, which is located on server
var fileId = "multipage.tif";
// get image collection of image viewer
var images = imageViewer.get_Images();
// add all images from multipage TIFF file to the end of image collection
images.openFile(fileId, __openFile_success);
Here is an example that shows how to clear image collection of web image viewer, load images from several image files, which are located on server, and add created images to the image collection:
// array of file identifiers
var filesIds = ["image.png", "multipage.tif", "multipage.pdf"];
// get image collection of image viewer
var images = imageViewer.get_Images();
// clear image collection and add all images from image files to the image collection
images.openFiles(filesIds);
Here is an example that shows how to load images from several image files, which are located on server, and add created images to the image collection of web image viewer:
// File is opened successfully. This function is obligatory because without this function the image collection will be cleared.
function __openFile_success(data) {
// an array of WebImageJS objects, which represent images from opened image files
var newImages = data.images;
// add images to the end of image collection
images.addRange(newImages);
}
// array of file identifiers
var filesIds = ["image.png", "multipage.tif", "multipage.pdf"];
// get image collection of image viewer
var images = imageViewer.get_Images();
// add all images from image files to the end of image collection
images.openFiles(filesIds, __openFile_success);
Here is an example that shows how to create web image, which is associated with the first page of TIFF file, and add created image to the image collection of web image viewer:
// identifier of multipage TIFF file, which is located on server
var fileId = "multipage.tif";
// create source of image file (with default image service)
var imageSource = new Vintasoft.Shared.WebImageSourceJS(fileId);
// create WebImageJS object, which is associated with the first page of multipage TIFF file
var image = new Vintasoft.Shared.WebImageJS(imageSource, 0);
// get image collection of image viewer
var images = imageViewer.get_Images();
// add new image to the image collection of image viewer
// Important: Image collection must not contain identical image, i.e. images with the same source identifier and page index.
images.add(image);
Open image file stored in database
SDK can open images, which are stored in database or any other data storage. More info please read in the article:
How to view images from database.