Does anyone know of a multi-page TIFF file viewer that is like PDF.JS that will work with WiseJ?
Need to add TIFF file viewing to an application.
Actually you can use the PictureBox as-is for multi page tiff, just override OnPaint in your derived class like this:
protected override void OnPaint(PaintEventArgs e) { this.Image.SelectActiveFrame(FrameDimension.Page, pageIndex); base.OnPaint(e); }
Now you can assign the Image property of pictureBox1.Image = Image.FromFile(“multi page tiff”).
Managing pageIndex and the page count is up to your class.
There isn’t any decent javascript tiff viewer around. But Wisej already supports viewing tiff in the PictureBox control. The best way to view a tiff is to draw it into an image. And all Wisej controls support the Paint event. The PictureBox already recognizes a tiff file and will convert it to a png and display it in the PictureBox using all the different SizeMode options.
But it doesn’t support the multi pages as a built-in functionality. However, it’s easy to add. You can create a derived PictureBox class, say TiffViewer. Attach to the Paint event. In the paint event use:
var g = e.Graphics; g.DrawImage(image, ... arguments depends on scaling);
Load the image object from the tiff file using Image.FromFile().
To read the number of pages in the tiff use:
var pageCount = image.GetFrameCount(FrameDimension.Page);
To display a specific page use this before g.DrawImage(image).
image.SelectActiveFrame(FrameDimension.Page, pageIndex);
HTH
Please login first to submit.