Displaying multi-page tiff files using the ImageBox control and C#
A brief article showing how to display individual pages from a multi-page tiff file in the ImageBox control.
Our last post before the new year and some new material is an
update to the
ImageBox (now at version 22.214.171.124) and
(at version 126.96.36.199) controls. You can grab the updated source
from the links at the end of the post, or from the GitHub
IsPointInImagemethod. This function returns if a given point is within the image viewport, and is useful for combining with
ImageBorderColorproperty, allowing you to customize the color of the image border
FixedSingleGlowShadow. This style allows for a more smoother outer glow shadow instead of the existing clunky drop shadow.
PixelGridColorproperties. When set, a dotted grid is displayed around pixels when zooming in on an image.
PointToImagewhich allows you to specify if the function should map the given point to the nearest available edge(s) if the point is outside the image boundaries
AllowDoubleClickproperty. When set, the normal double click events and overrides work as expected.
VirtualSizeproperties. These new properties allow you to use all functionality of the ImageBox control without having to set the
Imageproperty. You can also use the new
VirtualDrawevent to provide custom drawing without having to override existing drawing functionality.
GridDisplayModeproperty is set to
Imagean explicit image border is no longer drawn, instead the
ImageBorderproperty is correctly honoured.
GetImageViewportmethod now correctly returns a width and height that accounts for control size, padding and zoom levels.
ShowTabListproperty. When set to
False, the list of tabs is no longer displayed, and navigation can only occur via code.
AllowTabSelectionproperty. When set to
False, the control can no longer gain focus, mouse hover effects are not displayed, and navigation can only occur via code. This allows you to disable navigation whilst still having the tabs visible.
HoverIndexproperty always defaulting to zero.
Happy New Year all!
Like what you're reading? Perhaps you like to buy us a coffee?