Interpolation mode used by this ImageViewer.
Object.defineProperty(ImageViewer.prototype, 'interpolationMode',
get: function(),
set: function(value)
)
interpolationMode: InterpolationMode;
The interpolation mode used by this ImageViewer. Default value is InterpolationMode.None.
For more information, refer to Image Viewer Interpolation.
Run the below demo and as you click the "Example" button, the viewer will cycle through the interpolation modes.
Start with the ImageViewer example, remove all the code inside the example function (search for the "// TODO: add example code here" comment) and insert the following code
var _interpolationModeNames = ["None", "Resample", "ScaleToGray"];
var _interpolationModeStatus = ["Started", "Completed", "Aborted", "Error"];
var urls = [
"http://demo.leadtools.com/images/png/ocr1.png",
"http://demo.leadtools.com/images/png/ocr2.png",
"http://demo.leadtools.com/images/png/ocr3.png",
"http://demo.leadtools.com/images/png/ocr4.png"
];
// Optional: tell the imageViewer to interpolate in parallel
this._imageViewer.interpolationRunMode = lt.Controls.InterpolationRunMode.Parallel;
this._imageViewer.beginTransform();
for (var urlIndex = 0; urlIndex < urls.length; urlIndex++) {
var item = new lt.Controls.ImageViewerItem();
item.text = "Item" + urlIndex;
item.resolution = lt.LeadSizeD.create(300, 300);
item.url = urls[urlIndex];
this._imageViewer.items.add(item);
}
this._imageViewer.endTransform();
this._imageViewer.interpolation.add(function (sender, e) {
var itemIndex = this._imageViewer.items.indexOf(e.item);
alert("Interpolation Item(" + itemIndex + ") ," + _interpolationModeNames[e.mode] + " " + _interpolationModeStatus[e.status]);
if (e.status == lt.Controls.InterpolationStatus.error) {
alert(" Error name:" + e.error.name + " message:" + e.error.message);
}
});
var interpolationModes = [lt.Controls.InterpolationMode.none, lt.Controls.InterpolationMode.resample, lt.Controls.InterpolationMode.scaleToGray];
// Add a combobox control to show the items
var comboBox = document.getElementById("combo");
for (var index = 0; index < interpolationModes.length; index++) {
var value = interpolationModes[index];
var option = document.createElement("option");
option.textContent = _interpolationModeNames[value];
comboBox.appendChild(option);
}
var myImageViewer = this._imageViewer;
comboBox.addEventListener("change", function () {
var index = comboBox.selectedIndex;
switch (index) {
case 0:
myImageViewer.interpolationMode = lt.Controls.InterpolationMode.none;
break;
case 1:
myImageViewer.interpolationMode = lt.Controls.InterpolationMode.resample;
break;
case 2:
myImageViewer.interpolationMode = lt.Controls.InterpolationMode.scaleToGray;
break;
}
});
Products |
Support |
Feedback: interpolationMode Property (ImageViewer) - Leadtools.Controls |
Introduction |
Help Version 19.0.2017.3.21
|
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.