<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>http://www.fsdeveloper.com/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=SamSam</id>
	<title>FSDeveloper Wiki - User contributions [en-gb]</title>
	<link rel="self" type="application/atom+xml" href="http://www.fsdeveloper.com/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=SamSam"/>
	<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php/Special:Contributions/SamSam"/>
	<updated>2026-07-26T20:45:37Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=BMP&amp;diff=7899</id>
		<title>BMP</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=BMP&amp;diff=7899"/>
		<updated>2011-01-14T16:46:23Z</updated>

		<summary type="html">&lt;p&gt;SamSam: New page: In this article we will focus on the Flight Simulator flavored version of BMP used for textures, an extension of the BMP or Bitmap File Format, a well known image format mainly used on Mic...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In this article we will focus on the Flight Simulator flavored version of BMP used for textures, an extension of the BMP or Bitmap File Format, a well known image format mainly used on Microsoft Windows operating systems. These files are usually generated with ImageTool that comes with the SDK.&lt;br /&gt;
&lt;br /&gt;
There are two differences with a standard BMP :&lt;br /&gt;
* the header have an &amp;quot;FS70&amp;quot; extension;&lt;br /&gt;
* the pixels may be stored in various [[DXT]] format.&lt;br /&gt;
&lt;br /&gt;
== Standard Header Structure ==&lt;br /&gt;
&lt;br /&gt;
Here is the equivalent C++ structure of the header. It start with magic signature :&lt;br /&gt;
&lt;br /&gt;
  struct BITMAPMAGIC {&lt;br /&gt;
    BYTE Magic[2];        //Magic is always {&#039;B&#039;, &#039;M&#039;}&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
It is immedialty followed (without padding) by the file header :&lt;br /&gt;
 &lt;br /&gt;
  struct BITMAPFILEHEADER {&lt;br /&gt;
    DWORD Size;        //The total size of the file&lt;br /&gt;
    WORD Creator1;    //Application depend&lt;br /&gt;
    WORD Creator2;    //Application depend&lt;br /&gt;
    DWORD Offset;      //Offset tot eh pixel data&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Then follows the bitmap infos :&lt;br /&gt;
&lt;br /&gt;
  struct BITMAPINFO {&lt;br /&gt;
    BITMAPINFOHEADER Header;&lt;br /&gt;
    RGBQUAD          Colors[1];&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
where BITMAPINFOHEADER is :&lt;br /&gt;
&lt;br /&gt;
  struct BITMAPINFOHEADER {&lt;br /&gt;
    DWORD Size;             //The size of this header (40)&lt;br /&gt;
    LONG  Width;            //The width of the image in pixel&lt;br /&gt;
    LONG  Height;           //The height of the image in pixel&lt;br /&gt;
    WORD  Planes;           //The number of planes (1)&lt;br /&gt;
    WORD  BitCount;         //The number of bits-per-pixel&lt;br /&gt;
    DWORD Compression;      //The type of compression&lt;br /&gt;
    DWORD SizeImage;        //The size of the image in bytes&lt;br /&gt;
    LONG  XPelsPerMeter;    //The horizontal resolution&lt;br /&gt;
    LONG  YPelsPerMeter;    //The vertical resolution&lt;br /&gt;
    DWORD ClrUsed;          //The number of color indexes actually used&lt;br /&gt;
    DWORD ClrImportant;     //The number of color indexes required&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
and RGBQUAD is &lt;br /&gt;
&lt;br /&gt;
  struct RGBQUAD {&lt;br /&gt;
    BYTE Blue;&lt;br /&gt;
    BYTE Green;&lt;br /&gt;
    BYTE Red;&lt;br /&gt;
    BYTE Reserved;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
and contains a possible palette. So far, we are on familiar ground. For more details you may found the following links usefull :&lt;br /&gt;
&lt;br /&gt;
[[http://msdn.microsoft.com/en-us/library/dd183377 MSDN]] &lt;br /&gt;
[[http://en.wikipedia.org/wiki/BMP_file_format WikiPedia]] &lt;br /&gt;
&lt;br /&gt;
== FSX Header Structure ==&lt;br /&gt;
&lt;br /&gt;
After the standard header a FS70 extension is found :&lt;br /&gt;
&lt;br /&gt;
  struct BITMAPFSXHEADER {&lt;br /&gt;
    BYTE Format[4];         //Format is always {&#039;F&#039;, &#039;S&#039;, &#039;7&#039;, &#039;0&#039;}. &lt;br /&gt;
    DWORD Version;	   //Version is always 20  &lt;br /&gt;
    BYTE Reserved;&lt;br /&gt;
    BYTE Alpha;             //Set to 1 if the BMP has an alpha layer&lt;br /&gt;
    BYTE Reserved;&lt;br /&gt;
    BYTE Reserved;&lt;br /&gt;
    BYTE HasBorder;         //Set to 1 is the BMP has a 1 pixel border&lt;br /&gt;
    WORD NbMips;            //The number of mips&lt;br /&gt;
    DWORD Reserved;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Some of the Reserved fields may have meanings that are not discovered yet.&lt;br /&gt;
&lt;br /&gt;
== Pixel Data ==&lt;br /&gt;
&lt;br /&gt;
Right after the FS70 header the pixel section stored uncompressed (packed in rows) or in compressed format.&lt;br /&gt;
&lt;br /&gt;
For an uncompressed format the expected size of this section is ImageHeight * ImageWidth * BitsPerPixel / 32  * 4.&lt;br /&gt;
&lt;br /&gt;
[[category:File Formats]]&lt;br /&gt;
[[category:FSX]]&lt;/div&gt;</summary>
		<author><name>SamSam</name></author>
	</entry>
</feed>