GetZoomLevel always returns zero

Having problems with building or using the CefGlue .NET/Mono binding? Ask your questions here.

Moderator: fddima

GetZoomLevel always returns zero

Postby AndyB » Fri Jul 28, 2017 4:11 pm

I can set the zoom level by calling SetZoomLevel(), this seems to work fine.
However, GetZoomLevel() always returns 0.
AndyB
Techie
 
Posts: 39
Joined: Sun Apr 16, 2017 3:00 pm

Re: GetZoomLevel always returns zero

Postby magreenblatt » Fri Jul 28, 2017 4:40 pm

This method can only be called on the UI thread. Are you calling it on the correct thread?
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: GetZoomLevel always returns zero

Postby AndyB » Fri Jul 28, 2017 5:11 pm

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.
AndyB
Techie
 
Posts: 39
Joined: Sun Apr 16, 2017 3:00 pm

Re: GetZoomLevel always returns zero

Postby AndyB » Fri Jul 28, 2017 7:22 pm

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.
AndyB
Techie
 
Posts: 39
Joined: Sun Apr 16, 2017 3:00 pm


Return to CefGlue Forum

Who is online

Users browsing this forum: No registered users and 17 guests