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 1.1.2.0) and TabList
(at version 1.0.0.2) controls. You can grab the updated source
from the links at the end of the post, or from the GitHub
page.
ImageBox
Changes and new features
- Added
IsPointInImage
method. This function returns if a given point is within the image viewport, and is useful for combining withPointToImage
. - Added
ImageBorderColor
property, allowing you to customize the color of the image border - Added a new
ImageBoxBorderStyle
,FixedSingleGlowShadow
. This style allows for a more smoother outer glow shadow instead of the existing clunky drop shadow. - Added
ShowPixelGrid
andPixelGridColor
properties. When set, a dotted grid is displayed around pixels when zooming in on an image. - Added new overload to
PointToImage
which 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 - Added
AllowDoubleClick
property. When set, the normal double click events and overrides work as expected. - Added
VirtualMode
andVirtualSize
properties. These new properties allow you to use all functionality of the ImageBox control without having to set theImage
property. You can also use the newVirtualDraw
event to provide custom drawing without having to override existing drawing functionality. - Additional documentation added via XML comments
Fixed
- If the
GridDisplayMode
property is set toImage
an explicit image border is no longer drawn, instead theImageBorder
property 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.
- The
GetImageViewport
method now correctly returns a width and height that accounts for control size, padding and zoom levels. - Fixed incorrect attributes on
AutoSize
property - 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
TabList
Changes and new features
- Added
ShowTabList
property. When set toFalse
, the list of tabs is no longer displayed, and navigation can only occur via code. - Added
AllowTabSelection
property. When set toFalse
, 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
- Fixed the
HoverIndex
property always defaulting to zero.
Happy New Year all!
Update History
- 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 1.1.4.0 update
- ImageBox update, version 1.1.0.0
- 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
Downloads
Filename | Description | Version | Release Date | |
---|---|---|---|---|
Cyotek.Windows.Forms.ImageBox.zip
|
Cyotek ImageBox Control, 1.1.4.2 update |
1.1.4.2 | 13/02/2014 | Download |
Cyotek.Windows.Forms.TabList.zip
|
Cyotek.Windows.Forms.TabList control, a multi-paged container control with design time support and a Visual Studio 2012 look |
1.0.0.2 | 31/12/2012 | Download |
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?
Comments
Ferry
#
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.
Richard Moss
#
Hello,
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
Mario Muja
#
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?
Richard Moss
#
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
CD
#
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.
Richard Moss
#
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.
CD
#
Thanks. Just wanted to be sure I wasn't missing something. I am a noob to nuget.
Richard Moss
#
You're welcome. Question comes up every so often, I should probably add some instructions somewhere on how to do it!
Regards; Richard Moss
Konstantin Samsonov
#
Selection region in pixel mode not snap to pixel grid
Richard Moss
#
Correct, it doesn't - it was never designed to.
Should be easy enough to add, fee free to submit a pull request.
Jonathan
#
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?
Richard Moss
#
Hello,
You don't need to use the virtual mode for this - just hook into the
Paint
event and draw your shapes in that. See the Scaled Adornments demonstration for an example.Regards; Richard Moss