-
Hello! I created a little class to take screenshots and convert them to opencv's Mat objects
I'm gonna use the static method "ScreenShot" in endless while cycle. The method
takes snapshot from the entire monitor. I know that after taking the snapshot I can crop it! But taking a snapshot from entire screen is a slow operation. Is there the way to take a part of the screen using Magick.NET api? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Currently you can crop the image automatically like this: var settings = new MagickReadSettings
{
ExtractArea = new MagickGeometry(20, 30, 500, 400)
};
using (var image = new MagickImage("screenshot:", settings))
{
}
// OR
using (var image = new MagickImage("screenshot:[500x400+20+30]"))
{
} But this now takes a screenshot of the whole area instead of part of the screen. I just pushed a patch to impove the performance and only copy the pixels of the requested area. Not sure yet if this is a solid solution and it will need some more testing but I hope that this will become available in the next release. |
Beta Was this translation helpful? Give feedback.
Currently you can crop the image automatically like this:
But this now takes a screenshot of the whole area instead of part of the screen. I just pushed a patch to impove the performance and only copy the pixels of the requested area. Not sure yet if this is a solid solution and it will need some more testing but I hope that this will become available in the next release.