Sign in to follow this  
Guest dko60202

Scaling images in XML

Recommended Posts

Is it possible to scale an image, or element containing an image, in XML (by L:var, similar to Shift and Rotate?) Couldn't find a way all weekend, but it seems silly that this would have been left out of gauge XML...I'm working on a simple chart veiwer...XML may not work at all, as I also know of no way to dynamically load .jpgs or .gifs in XML (or even .bmps, dynamically....is it possible to reload a single window in a panel?)Failing this, can anyone recommend something out there for simple chart veiwing...no GPS, no moving maps, no "You Are Here" airplane - just something I can zoom and pan a chart with, preferably in a window I can undock and put on the second monitor? Please save me from a miserable existence, doomed to learning 'C' gauge programming....Douglas

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

You may be able to (in XML) define several image sizes in several elements and control visibility using a scale var.In other words, (L:Scale, number) 1 ==.., etc....(L:Scale, number) 2 ==.., etc....etc...I've never tried to use the ImageSizes tag in that way, but it seems some variation of it may work as a ghetto method of scaling your map. You'd be using the same image.The other method would be to load a different image (presumably at a different scale) based on the scale setting.(L:Scale, number) 1 ==.., etc....(L:Scale, number) 2 ==.., etc....Just a couple ideas to try...--Jon

Share this post


Link to post
Share on other sites

Jon,Thanks, your solution "B" was what I've come up with so far, but as you know, it's not ideal. I haven't been able to make ImageSizes (or ) do anything at all to the element/image.Gonna go try "HeightCode"...Douglas

Share this post


Link to post
Share on other sites

Jan,I'll check out HeightCode (and WidthCode) and report back here, thanks!Douglas

Share this post


Link to post
Share on other sites

The ImageSizes attributer reads ImageSizes="width,height,0,0".Play with the last two varibles of the ImageSize attribute. If they work the same as the variables used in an panel.cfg file you would have your solution.gauge #=gauge. X Y Width Heightgauge01=superh!hud2, 750, 641, 120, 120,

Share this post


Link to post
Share on other sites

>Play with the last two varibles of the ImageSize attribute. >If they work the same as the variables used in an panel.cfg>file you would have your solution.If they worked, I wouldn't have asked the question :-)Actually, according to the SDK, they're not supposed to work the same. ImageSizes specifies the width and height of each of two bitmaps (A throwback to FS95 days, I believe, when panels were distributed with 640x and 1024x graphics.) So: w1,h1,w2,h2 as opposed to the x,y,w,h syntax in panel.cfg.In any event, they appear to have no effect on the on-screen size of the image.I've been sidetracked installing and learning a c compiler so I haven't tried the suggested HeightCode, but I'm sceptical that it will work on images as well as polys.Douglas

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this