Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Read/Write zoom value?

Featured Replies

I've look in the SDK but can't find a call to read the current VC zoom level setting...is there a way to read it?

 

I also would like to set a VC zoom value and am wondering if this possible as well?

 

Thanks...

 

Ralph Freshour

www.GMTPilots.com

  • Author

So, this is what I've learned so far in case others are interested in this topic:

 

1. Microsoft didn't provide a way to read or get the current zoom level in SimConnect.  Period.

 

2. There is only one call constant (ZOOM1_X) to set the zoom level.  I'm programming in C# but I'll bet the C++ header file for this constant == 64. This constant sets the zoom level to 1.0.

 

3. While there is only one documented constant (ZOOM1_X)...you can send any integer value and get incremental zoom levels.  For example, send 32 to get .5 zoom level.

 

So, I guess I've now answered my own question.

Ralph Freshour

www.GMTPilots.com

  • Author
I'm wondering if someone could help me with actually implementing this 1.0 zoom level?
 
I'm doing this in C# and here is my code...I'm just trying to do a button click to set the zoom level but my code isn't working. I'm not sure where the problem is.
 
Thanks for any help.
 
        enum EVENTS : uint
        {
            ZOOM_1X,
        };

 

simconnect.MapClientEventToSimEvent(EVENTS.ZOOM_1X, "ZOOM_1X");

 

simconnect.TransmitClientEvent((uint)SimConnect.SIMCONNECT_OBJECT_ID_USER, EVENTS.ZOOM_1X, (uint)0, INPUT_GROUPS.INPUT0, SIMCONNECT_EVENT_FLAG.GROUPID_IS_PRIORITY);

Ralph Freshour

www.GMTPilots.com

  • 1 year later...

I know this is old, but this was helpful, and I figured out how to make the above examples work:

 

enum EVENT_ID
{
     ZOOM_1X
}
simconnect.TransmitClientEvent(SimConnect.SIMCONNECT_OBJECT_ID_USER, EVENT_ID.ZOOM_1X, 0, GROUP_ID.GROUP1, SIMCONNECT_EVENT_FLAG.GROUPID_IS_PRIORITY);

I didn't cast anything and my enums are not uint derived. Not sure if that makes any difference but it works for me.

 

I also figured out how to do more than just set the zoom to 1X. There are other zoom events. Specifically ZOOM_IN and ZOOM_OUT, except that they are backwards. ZOOM_IN zooms out and ZOOM_OUT actually zooms in.
 

enum EVENT_ID
{
    ZOOM_IN,
    ZOOM_OUT
}


//DEFINE EVENT
simconnect.MapClientEventToSimEvent(EVENT_ID.ZOOM_IN, "ZOOM_OUT");
simconnect.MapClientEventToSimEvent(EVENT_ID.ZOOM_OUT, "ZOOM_IN");

//TRIGGER EVENTS
simconnect.TransmitClientEvent(SimConnect.SIMCONNECT_OBJECT_ID_USER, EVENT_ID.ZOOM_IN, 0, GROUP_ID.GROUP1, SIMCONNECT_EVENT_FLAG.GROUPID_IS_PRIORITY);
simconnect.TransmitClientEvent(SimConnect.SIMCONNECT_OBJECT_ID_USER, EVENT_ID.ZOOM_OUT, 0, GROUP_ID.GROUP1, SIMCONNECT_EVENT_FLAG.GROUPID_IS_PRIORITY);

 

To get to .3x zoom, just set the zoom to 1X, then zoom out a few times (7 times, to be exact).

 

Hopefully this helps some people!

Nah, you don't do it like that. That's tedious.

You do it like this using the secret event:

P3D_simconnect.MapClientEventToSimEvent(EVENT_ID.EVENT_ZoomSet, "VIEW_ZOOM_SET")
P3D_simconnect.TransmitClientEvent(DEFINITIONS.Struct1, EVENT_ID.EVENT_ZoomSet, ZoomLevel * 64, hSimconnect.Group1, SIMCONNECT_EVENT_FLAG.GROUPID_IS_PRIORITY)

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.