ImageBox and TabList update's - virtual mode, pixel grid, bug fixes and more!

A newer version of this code is now available.

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 with PointToImage.
  • 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 and PixelGridColor 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 and VirtualSize properties. These new properties allow you to use all functionality of the ImageBox control without having to set the Image property. You can also use the new VirtualDraw 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 to Image an explicit image border is no longer drawn, instead the ImageBorder 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 to False, the list of tabs is no longer displayed, and navigation can only occur via code.
  • Added AllowTabSelection property. 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

  • Fixed the HoverIndex property always defaulting to zero.

Happy New Year all!

Downloads

Filename Description Version Release Date
Cyotek.Windows.Forms.ImageBox.zip
  • md5: eafe88cd279eec36bc79f6409f0fc49d

Cyotek ImageBox Control, 1.1.4.2 update

1.1.4.2 13/02/2014 Download
Cyotek.Windows.Forms.TabList.zip
  • md5: fbf021a18c325e7384b409ad256a9207

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

About The Author

Gravatar

The founder of Cyotek, Richard enjoys creating new blog content for the site. Much more though, he likes to develop programs, and can often found writing reams of code. A long term gamer, he has aspirations in one day creating an epic video game. Until that time, he is mostly content with adding new bugs to WebCopy and the other Cyotek products.

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?

Styling with Markdown is supported

Comments

Gravatar

Ferry

# Reply

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.

Gravatar

Richard Moss

# Reply

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

Gravatar

Mario Muja

# Reply

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?

Gravatar

Richard Moss

# Reply

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

# Reply

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.

Gravatar

Richard Moss

# Reply

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

# Reply

Thanks. Just wanted to be sure I wasn't missing something. I am a noob to nuget.

Gravatar

Richard Moss

# Reply

You're welcome. Question comes up every so often, I should probably add some instructions somewhere on how to do it!

Regards; Richard Moss

Gravatar

Konstantin Samsonov

# Reply

Selection region in pixel mode not snap to pixel grid

Gravatar

Richard Moss

# Reply

Correct, it doesn't - it was never designed to.

Should be easy enough to add, fee free to submit a pull request.