How to load and view images in ImageViewer with different rendering settings?
In This Topic
ImageViewer uses rendering settings from the
VintasoftImage.RenderingSettings property for rendering image if value of the
ImageViewer.ImageRenderingSettings property is NOT null.
ImageViewer uses rendering settings from the
VintasoftImage.RenderingSettings property for rendering image if value of the
ImageViewer.ImageRenderingSettings property is null.
Here is C#/VB.NET code that shows how load 2 PDF documents with different rendering settings in
ImageViewer:
// disable management of rendering settings in ImageViewer
imageViewer1.ImageRenderingSettings = null;
// create temporary image collection
Vintasoft.Imaging.ImageCollection images = new Vintasoft.Imaging.ImageCollection();
// add all pages of the first PDF document to temporary image collection
images.Add("testFile1.pdf");
// for each image in temporary image collection
for (int i = 0; i < images.Count; i++)
// change rendering settings of image
images[i].RenderingSettings.Resolution = new Vintasoft.Imaging.Resolution(300, 300);
// add images from temporary image collection to the image viewer
imageViewer1.Images.AddRange(images.ToArray());
// clear temporary image collection
images.Clear();
// add all pages of the second PDF document to temporary image collection
images.Add("testFile2.pdf");
// for each image in temporary image collection
for (int i = 0; i < images.Count; i++)
// change rendering settings of image
images[i].RenderingSettings.Resolution = new Vintasoft.Imaging.Resolution(100, 100);
// add images from temporary image collection to the image viewer
imageViewer1.Images.AddRange(images.ToArray());
' disable management of rendering settings in ImageViewer
imageViewer1.ImageRenderingSettings = Nothing
' create temporary image collection
Dim images As New Vintasoft.Imaging.ImageCollection()
' add all pages of the first PDF document to temporary image collection
images.Add("testFile1.pdf")
' for each image in temporary image collection
For i As Integer = 0 To images.Count - 1
' change rendering settings of image
images(i).RenderingSettings.Resolution = New Vintasoft.Imaging.Resolution(300, 300)
Next
' add images from temporary image collection to the image viewer
imageViewer1.Images.AddRange(images.ToArray())
' clear temporary image collection
images.Clear()
' add all pages of the second PDF document to temporary image collection
images.Add("testFile2.pdf")
' for each image in temporary image collection
For i As Integer = 0 To images.Count - 1
' change rendering settings of image
images(i).RenderingSettings.Resolution = New Vintasoft.Imaging.Resolution(100, 100)
Next
' add images from temporary image collection to the image viewer
imageViewer1.Images.AddRange(images.ToArray())