At the moment I’m able to get screenshot from selected camera, but zoom levels are ignored; the image is always captured at 100%
There is an overload -
virtual Bitmap VideoOS.Platform.Client.ImageViewerControl.GetCurrentDisplayedImageAsBitmap (bool digitalZoomOnly )
[inline, virtual]
-
Overloaded method to control if the original or the digital zoomed image is requested.
Ok…but how can I get the selected ImageViewerControl in the client?
When this is not stand-alone but Smart Client you would need to use ImageViewerAddOn instead. Unfortunately I find that ImageViewerAddOn.GetCurrentDisplayedImageAsBitmap does not have the mentioned overload.
You will not be able to get the zoomed image.
I will make a request for an enhancement to Milestone Product Mangement for this feature.
Oops..Ok.
Thank you. Please let me know when this feature will be available.
Hi Bo, any news?
At first I just looked at the interface, and with the parameter there I assumed you would not get the zoomed image. Now I have tested. I experience that you always get the zoomed in image.
I tested by inserting these two lines in the AnalyticsEvent plugin sample:
System.Drawing.Bitmap bitmap = addOn.GetCurrentDisplayedImageAsBitmap();
bitmap.Save(@"c:\Test\test.BMP", System.Drawing.Imaging.ImageFormat.Bmp);
Great! Now it works.
Thank you.
Hi guys,
I was trying to perform a screenshot by using GetCurrentDisplayedImageAsBitmap() using ImageViewerWpfControl, initialized as _imageViewerControl as in ComponentSample: PlaybackWpfUser.
It is a button trigger event and the video is showing on the ImageViewerWpfControl. However, the GetCurrentDisplayedImageAsBitmap() in the first try-catch always return null hence when I try to perform bitmap.Save(…) function, it always throw an exception indicates that “object reference not set to an instance”.
Attached below my cope snippet,
any clue(s)?
Thanks.
private void Button_Capture_Click(object sender, RoutedEventArgs e)
{
_imageViewerControl.Initialize();
_imageViewerControl.Connect();
Bitmap bitmap = new Bitmap(24, 24);
try
{
bitmap = _imageViewerControl.GetCurrentDisplayedImageAsBitmap();
}
catch (Exception ex)
{
ListBox_Debug.Items.Add("Get Error: " + ex.Message);
}
try
{
bitmap.Save("capture.bmp", System.Drawing.Imaging.ImageFormat.Bmp);
}
catch (Exception ex)
{
ListBox_Debug.Items.Add("Save Error: " + ex.Message);
}
}
Please start a new question, do not reuse an already answered question. If you start a new question it will greatly improve the usability of this forum. Let us keep this forum as useful as possible.
If no image is displayed this is the expected result. Make sure you wait till either live or playback images are displayed.