Get Image after digital zoom by Client Player

How can i get the zoomed image by digital zoom of the player?

By capture image I used the GetNearest() function of the BitmapVideoSource component:

BitmapVideoSource _bitmapVideoSource = new BitmapVideoSource(camera); _bitmapVideoSource.Init();
BitmapData bit = (BitmapData)_bitmapVideoSource.GetNearest(show);

If used this function during digital zoom, the image capture is not the zoomed image but the whole image, because rightly the zoom is digital.

Is there a way to capture the zoomed image?

If this is not possible, can zoom information be extracted?

Thanks.

Use System.Drawing.Bitmap VideoOS.Platform.Client.ImageViewerWpfControl.GetCurrentDisplayedImageAsBitmap()

Ref. https://doc.developer.milestonesys.com/html/index.html?base=miphelp/class_video_o_s_1_1_platform_1_1_client_1_1_image_viewer_wpf_control.html&tree=tree_search.html?search=imageviewer

(or VideoOS.Platform.Client.ImageViewerControl.GetCurrentDisplayedImageAsBitmap() if using WinForms instead of WPF.)

Ok thanks, GetCurrentDisplayedImageAsBitmap return the same image of bitmapVideoSource.GetNearest()? same resolution and same dimesions?

can i replace GetNearest() with GetCurrentDisplayedImageAsBitmap () without problems?

GetCurrentDisplayedImageAsBitmap is a method of the Image Viewer Control and therefore it will return exactly what you see in the control.

When you say you have zoomed my assumption is that you have an Image Viewer control and see the image within that control. If my assumptions are correct I believe using GetCurrentDisplayedImageAsBitmap will greatly simplify your code.

It will not return the same image of bitmapVideoSource.GetNearest, it will not return same resolution and same dimensions, because it will return the zoomed image instead.

The VideoPreview sample uses it in the Smart Client plugin. https://doc.developer.milestonesys.com/html/index.html?base=samples/pluginsamples/videopreview/readme.html&tree=tree_1.html

There is no standalone sample using this but you can use the same function in standalone.

I hope it fits to what you are looking for.

GetCurrentDisplayedImageAsBitmap return always an image, both with zoom and without zoom, so I was wondering how do i understand the image is with the zoom?

I guess you could see the resolution of the image you get and then compare it to the resolution you get from the BitmapVideoSource (which is always the resolution recorded) to see if it is smaller, if it is smaller you can conclude it is zoomed.

There is a sample that works with reading images and extracting the resolution: https://doc.developer.milestonesys.com/html/index.html?base=samples/componentsamples/camerastreamresolution/readme.html&tree=tree_2.html

I am in doubt of the use case scenario, so if my answer does not fit please elaborate on the use case scenario.

ok thanks,

that’s what I did.

I only wanted confirmation of this.