July 7, 20187 yr I have an emergency announcer gauge/light matrix in bitmap form. I wish to crop a single light from it to then display on a 2D cockpit graphic. In XML how do I crop the bitmap image and then position it in the 2D instrument panel?
July 8, 20187 yr Moderator As far as I can determine, there's no mechanism in XML to allow 'cropping' of a small section of a large bitmap. Only two integer values are allowed for image objects, those being limited to the height and width of the bitmap. Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
July 8, 20187 yr You can simply open the bitmap in paint and crop the light you want. Then save as “my light” position it on the background 2d panel in xml : Position x = *** y = *** usually the top left of the background is 0,0 I use paint, to get a rough idea where I want the light. Place your mouse curser where you want the light and look at the lower left corner in the paint window, you’ll see something like 388,433. enter those numbers in the position section of the xml , test and run, adjust as necessary MUCH more available online if you wanna learn it 👀 Luke Pype
July 9, 20187 yr Moderator Of course one can manually 'crop' out and isolate the image, but that isn't what was being asked about. Dynamic cropping would require something like this (which doesn't exist!) <Image> Name="3D_Altimeter_bgnd.bmp" X="320" Y="213" W="23" H="18"</Image> Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
July 9, 20187 yr No that’s right it’s not what is being asked about but I have given a little light at the end of the tunnel🤗 instead of a slammed door ( as I know full well what it’s like in that kind of situation, asking at forums and getting nothing back, from certain Flight Sim development sites..) because as you say what the op is asking doesn’t exist! Edited July 9, 20187 yr by MaDDogz Luke Pype
July 13, 20187 yr Image cropping can be done using Clip, whose attributes are Top, Left, Bottom, Right, Width, and Height. For example: <Element> <Position X="10" Y="300"/> <Image Name="PictureA.bmp"/> <Clip Top="310" Left="20" Width="25" Height="25"/> </Element> It's not limited to bmp images. One can Clip any individual Element display such as a gps map, or annunciator gauge elements if it's an XML gauge. Clip is not dynamic in the sense that it's attributes are not variables that can be changed while the gauge is running. The attributes are set when the gauge loads. I get the idea that OP petfy may want one particular annunciator light from the annunciator gauge to be displayed, and functional, in the 2D gauge. In that case, I suggest making the effort to figure out, if it is possible, what conditions trigger the light and write that into the 2D gauge. And, if the code running the announcer gauge is hidden (e.g., .gau file), then there's nothing to apply Clip, or a Mask Image to, anyway. Bob Edited July 13, 20187 yr by Propwash
July 18, 20187 yr Edit - Clip and RelClip height and width can be manipulated dynamically using <HeightCode> and <WidthCode> See this FSDeveloper post Bob
Archived
This topic is now archived and is closed to further replies.