Page 1 of 1

GetZoomLevel always returns zero

PostPosted: Fri Jul 28, 2017 4:11 pm
by AndyB
I can set the zoom level by calling SetZoomLevel(), this seems to work fine.
However, GetZoomLevel() always returns 0.

Re: GetZoomLevel always returns zero

PostPosted: Fri Jul 28, 2017 4:40 pm
by magreenblatt
This method can only be called on the UI thread. Are you calling it on the correct thread?

Re: GetZoomLevel always returns zero

PostPosted: Fri Jul 28, 2017 5:11 pm
by AndyB
Yep, probably not.
I call it on my applications main UI thread. I need to figure out how to call it correctly.

There is no easy way to keep track of zoom level changes?
For ex. if there would be a CefDisplayHandler.ZoomLevelChanged method then i could easily store the current zoom level in a variable.

Re: GetZoomLevel always returns zero

PostPosted: Fri Jul 28, 2017 7:22 pm
by AndyB
All fine, Xilium.CefGlue.CefRuntime.PostTask(Xilium.CefGlue.CefThreadId.UI, .... does the trick.
So, i have at least a workaround for the not working shrink page by touch zoom issue, they can now zoom in/out also by clicking on buttons.
Anyway, something like a CefDisplayHandler.ZoomLevelChanged method would be great, then i could use a zoom slider that gets changed when zoomed by pinch gesture.