Jump to content
Sign in to follow this  
Guest Vorlin

Scaling images in XML revisited ( imagesizes is not the answer)

Recommended Posts

Guest Vorlin

All,A forum search drew a blank while looking for an answer about how to scale and image in xml as can be done in C. I now understand that the imagesizes tag is actually used to refer to the different sizes of identical bitmaps that are for larger and smaller resolutions when two versions are used, so there seems to be nothing that will help there.I went to that DTD I made from 20,000 lines of combined code and this is what's listed in the image section:According to this, not one single image in any of the files I used to make the DTD had been scaled. I checked the Element tag to see if it was a case of scaling the parent of the image, but there's nothing there either.I'm beginning to wonder if the capability was accidently left out of the XML implementation for FS9... maybe they were rushed to meet a deadline and overlooked it.Has anyone had any luck with scaling an image in any way? The ability to scale X and Y seperately, as in C gauges, would be best but any sort of ability to scale at all would be something.Oh, yes I will be adding the Alpha attribute in by hand a little later today. I'm in the process of many things, including a PDF explaination to help those not fluent in DTD to understand how refering to it can help make their lives easier.Scott / Vorlin

Share this post


Link to post
Share on other sites

Keep in mind Scott, that the actual drawing is being done 'behind the scenes' using plain-vanilla GDI pens and brushes. You should be able to resize any XML gauge without having to explictly "do" anything yourself.


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites
Guest Vorlin

*Chuckle*Bill, I wish that I knew enough about GDI to understand what you just said!I *should* be around on HoverControl's Teamspeak tomorrow afternoon. I have an ortho appt at 7:30 AM and see zero chance that they'll allow me to work with my shoulder the way it is right now. Of course, I may have to spend the day beginning the workman's comp battle.If we're both around, maybe you could explain a little of the above to me?Thanks,Scott / Vorlin

Share this post


Link to post
Share on other sites
Guest iholrf

Its a tad hard to determine what it is you're asking. When you say scale, what do you mean precisely?For an XML gauge, the image size is irrelevent. I could write all my XML gauges to use 1024x1024 bitmaps if I wanted too. What is relevent is the code that interacts with the components is written to match the size of the gauge bitmaps. The gauge is "Scaled" by the sizing information in the panel config, thus ensuring that all elements of the gauge are scaled at the same time to the same degree.This contrasts with GDI (or vector drawn) gauges wherein you define the size of the drawn elements directly but they are in relation to the overall elemental definition. There are no "bitmaps" per say in this type of gauge as the drawing is done at runtime (though a bitmap backgrounds are possible). It still scales like above though.This make any sense? :)CheersShad

Share this post


Link to post
Share on other sites
Guest Vorlin

It makes good sense but here's a scenario for you:You're building a whatchamacallit gauge... you have, from other efforts, many bitmaps that you can combine to make a really cool gauge. However, all of them but one are 256x256 while the other one is some odd size, perhaps it's a cropped photo or something like that.Do you have to resize that image with another program and resave or can you use xml to specify that you want this image displayed at a size other than it's original size.Or...You want to change the aspect of some text, make it taller. You could just scale the Y size of the image while leaving the X size alone to make them taller and skinnier. This is possible in C gauges, in fact it's easy. But I see no way to accomplish the same thing in XML.Scott / Vorlin

Share this post


Link to post
Share on other sites
Guest iholrf

Nod, the problem is C gauges are compiled dlls that use regular libraries. The XML used in FS is a subset of real XML (and MS-ized) and relies on the quality of the interpreter built within the sim itself.To be honest, Scott, I have not tried to scale images within XML as I create them all from scratch now. When I make a new one, I will see whats going on with the interpreter.So the short answer is, I would be rescaling the off-sized image with PSP or photoshop.CheersShad

Share this post


Link to post
Share on other sites
Guest Vorlin

Yea, that's what I was afraid of. In that case, I think I'm going to do a batch conversion of all my originals into an RGBA mode, lossless format to ensure that manipulating and resaving several times as I reuse them doesn't degrade the quality of the image. Once I have it the size, alpha, perspective, etc. that I need, then I can convert the format into something usable by FS.Scott / Vorlin

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  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...