Reply to 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?
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?
Richard Moss
#
Glad you're finding it useful! You can use the
PointToImageto convert a point such as that fromMouseEventArgsinto the appropriate location within the image. You can then use that result to query the bitmap either viaBitmap.GetPixelor via the direct pixels if you have already extracted and stored these viaBitmap.Lockbits. (The former is going to be slow, especially if you are going to be updating as you move the mouse around, whilst the latter is complicated to explain especially if you use pointers). Both of these assume you are using aBitmapobject even though theImageBoxuses the more genericImageinstead. Although now that I think, I've never tested (or used for that matter) a metafile.PS: I noticed in your article that you're linking to an older version of the code. Might be better to link to the GitHub page for this project instead (https://github.com/cyotek/Cyotek.Windows.Forms.ImageBox) or it's NuGet package (https://www.nuget.org/packages/CyotekImageBox/). Hmm, or maybe I should add an overview page to this site instead of scattered blog posts.
Hope that helps! Regards