ImageBox and TabList update's - virtual mode, pixel grid, bug fixes and more!
Our last post before the new year and some new material is an
update to the
ImageBox (now at version 188.8.131.52) and
(at version 184.108.40.206) controls. You can grab the updated source
from the links at the end of the post, or from the GitHub
Changes and new features
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
- Added a new
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.
- Added new overload to
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.
- Additional documentation added via XML comments
- If the
GridDisplayModeproperty is set to
Imagean explicit image border is no longer drawn, instead the
ImageBorderproperty is correctly honoured.
- Fixes a problem where half the pixels of the first row/column were lost when zooming. Thanks to Rotem for the fix.
GetImageViewportmethod now correctly returns a width and height that accounts for control size, padding and zoom levels.
- Fixed incorrect attributes on
- Fixed the image viewport sometimes being the incorrect size when zoomed in. Thanks to WMJ for the fix.
- Fixes "see also" documentation errors for events
Changes and new features
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.
- Fixed the
HoverIndexproperty always defaulting to zero.
Happy New Year all!
- 2012-12-31 - First published
- 2020-11-21 - Updated formatting
Related articles you may be interested in
- Displaying multi-page tiff files using the ImageBox control and C#
- Adding drag handles to an ImageBox to allow resizing of selection regions
- ImageBox 220.127.116.11 update
- ImageBox update, version 18.104.22.168
- Zooming to fit a region in a ScrollableControl
- Zooming into a fixed point on a ScrollableControl
- Arcade explosion generator
- Creating an image viewer in C# Part 5: Selecting part of an image
- Extending the ImageBox component to display the contents of a PDF file using C#
- Creating a scrollable and zoomable image viewer in C# Part 4
- Creating a scrollable and zoomable image viewer in C# Part 3
- Creating a scrollable and zoomable image viewer in C# Part 2
- Creating a scrollable and zoomable image viewer in C# Part 1
Cyotek ImageBox Control, 22.214.171.124 update
Cyotek.Windows.Forms.TabList control, a multi-paged container control with design time support and a Visual Studio 2012 look
Leave a Comment
While we appreciate comments from our users, please follow our posting guidelines. Have you tried the Cyotek Forums for support from Cyotek and the community?
Hi, i've been trying out the imagebox for a project of mine. i've done the entire 'tutorial' and everything worked properly till part 5. But because i wanted to remove the 'flicker' i really want to use the latest version. only in this version for some reason the imagebox doesnt refresh when panning like it did before. It seems to only update(repaint) when you stop moving the mouse. I want the image to move with the mouse, not just update when done. I hope you have any idea why this doesn't work like that in this newest version.
I'm using the virtual mode and i draw a small list of images in the viewport.
Thanks for the comment. I have a pending update with a fix for drag and drop, I'll take a look at this issue as well and fix it.
Thanks; Richard Moss
Thanks a lot for your efforts. The selection region looks very nice. For my current project, I need multiple selection regions within the same image (enable the user to click into selection regions within the image to "activate" the region and allow to change the size of the region). I can implement the management of multiple selection regions for the same image - do you see an easier solution using your libraries?
Thanks for your interest! The last update to the control (http://www.cyotek.com/blog/adding-drag-handles-to-an-imagebox-to-allow-resizing-of-selection-regions) includes a new demo control that allows you to move and resize the selection. I see no reason why you couldn't tinker this control to support multiple selections reasonably easily. Hmm, in fact that may be a good excuse for a new blog post on the subject (besides I have a bug fix to make to the new control anyway :))
Regards; Richard Moss
Does the nuget package add the imagebox control to the toolbox to be able to drag over to form or do I need to use the nuget package through code only? As the nuget package seems not to add it to the toolbox for me.
No, it doesn't add a toolbox item - this isn't something a NuGet package can do. And besides, it wouldn't be desirable behaviour either given that each solution will get a fresh copy of the package. You would need to either manually add it to the toolbox (which I wouldn't do) or create any control on your form, then open the .designer file and change it to be an ImageBox. Not ideal, but not too much of a hassle either.
Thanks. Just wanted to be sure I wasn't missing something. I am a noob to nuget.
You're welcome. Question comes up every so often, I should probably add some instructions somewhere on how to do it!
Regards; Richard Moss
Selection region in pixel mode not snap to pixel grid
Correct, it doesn't - it was never designed to.
Should be easy enough to add, fee free to submit a pull request.
I'm trying to import an image into the imagebox and then draw a rectangle, but the virtual property mode in true takes it out to the image some solution so I can draw on the image?
You don't need to use the virtual mode for this - just hook into the
Paintevent and draw your shapes in that. See the Scaled Adornments demonstration for an example.
Regards; Richard Moss