<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: read bitmap from file to array in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/read-bitmap-from-file-to-array/m-p/988120#M27652</link>
    <description>I receive the information.  &lt;BR /&gt;Thank you very much for the help. &lt;BR /&gt;OPiedrahita</description>
    <pubDate>Fri, 19 Apr 2002 03:13:14 GMT</pubDate>
    <dc:creator>Intel_C_Intel</dc:creator>
    <dc:date>2002-04-19T03:13:14Z</dc:date>
    <item>
      <title>read bitmap from file to array</title>
      <link>https://community.intel.com/t5/Software-Archive/read-bitmap-from-file-to-array/m-p/988116#M27648</link>
      <description>Dear all, &lt;BR /&gt;I need to read several bitmap (*.bmp) files into a 3-D array to work on the pixel values.  &lt;BR /&gt;I found a solution using Quickwin &amp;amp; LOADIMAGE &amp;amp; GETPIXEL. However this is very time consuming, so reading 500 files takes very long. &lt;BR /&gt;I tried to use other options, e.g. using GETIMAGE which reads the screen image into a buffer. However, I wasn't able to interprete the buffer format, and I also found that the buffer format differs on Windows98 and Windows 2000. &lt;BR /&gt;Then I tried the subroutine "BitmapGet" which is part of the QUICKWIN samples. I was able to read data which was created using "BitmapPut", but not when the screen was created using LOADIMAGE. &lt;BR /&gt;Does anybody know a better solution for this task? If necessary, I can provide the test program I'm working with. &lt;BR /&gt;Best regards, Reiner</description>
      <pubDate>Wed, 17 Apr 2002 21:35:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/read-bitmap-from-file-to-array/m-p/988116#M27648</guid>
      <dc:creator>reinerb</dc:creator>
      <dc:date>2002-04-17T21:35:18Z</dc:date>
    </item>
    <item>
      <title>Re: read bitmap from file to array</title>
      <link>https://community.intel.com/t5/Software-Archive/read-bitmap-from-file-to-array/m-p/988117#M27649</link>
      <description>Reiner  &lt;BR /&gt;I do not have any solution to your problem, but could I know the way you are using BitmapGet and BitmapPut to make the buffer? My e-mail is in_vision@cablerocket.com.  &lt;BR /&gt;Thanks in advance  &lt;BR /&gt;OPiedrahita</description>
      <pubDate>Thu, 18 Apr 2002 00:00:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/read-bitmap-from-file-to-array/m-p/988117#M27649</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2002-04-18T00:00:32Z</dc:date>
    </item>
    <item>
      <title>Re: read bitmap from file to array</title>
      <link>https://community.intel.com/t5/Software-Archive/read-bitmap-from-file-to-array/m-p/988118#M27650</link>
      <description>I think you'd be better off using a little Windows API than coping with GetImage/BitmapGet. Maybe API wouldn't be even necessary -- you should be able to parse the .bmp file yourself without involving any GUI operations. &lt;BR /&gt; &lt;BR /&gt;The .bmp file consists of BITMAPFILEHEADER structure followed by BITMAPINFOHEADER structure. Then comes an array of bitmap data. You can find detailed specification of the format on &lt;A href="http://www.wotsit.org" target="_blank" www.wotsit.org=""&gt;&lt;/A&gt;. There are few tricky issues involved:  &lt;BR /&gt; &lt;BR /&gt;First, contents of the bitmap data depend on color depth. The easiest one is 24-bit bitmap -- the contents is simply an array of {R,G,B} triplets. For other formats, carefully check the documentation. &lt;BR /&gt; &lt;BR /&gt;Second, if you want to put the data in a &lt;B&gt;matrix&lt;/B&gt; you have to be careful with upside-down order, column-major vs. row-major order and especially padding used to align rows to 4-byte boundary. &lt;BR /&gt; &lt;BR /&gt;If you want more general solution, you could use the following APIs:&lt;BR /&gt; &lt;BR /&gt;&lt;CODE&gt;hBmp = LoadImage(...LR_LOADFROMFILE)&lt;/CODE&gt; to load the bitmap;&lt;BR /&gt; &lt;BR /&gt;&lt;CODE&gt;hMemDC = CreateCompatibleDC&lt;/CODE&gt; to create a DC (canvas) in memory to put bitmap to;&lt;BR /&gt; &lt;BR /&gt;&lt;CODE&gt;i = SelectObject(hMemDC, hBmp)&lt;/CODE&gt; to associate the bitmap with the DC&lt;BR /&gt;; &lt;BR /&gt;&lt;CODE&gt;i = GetObject(hBmp, SIZEOF(cBmp), LOC(cBmp))&lt;/CODE&gt; to get info about the bitmap (size, depth etc)&lt;BR /&gt;; &lt;BR /&gt;&lt;CODE&gt;i = GetDIBits(...)&lt;/CODE&gt; to get an array of bitmap data&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;There's a Fortran sample for storing the bitmap &lt;A href="http://www7.compaq.com/forum?14@@.ee8a85d  !SearchMark=1#1" target="_blank"&gt;here&lt;/A&gt;. I think it's worth a look. Sorry, I can't provide any sample code myself. &lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;Jugoslav</description>
      <pubDate>Thu, 18 Apr 2002 17:27:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/read-bitmap-from-file-to-array/m-p/988118#M27650</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2002-04-18T17:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: read bitmap from file to array</title>
      <link>https://community.intel.com/t5/Software-Archive/read-bitmap-from-file-to-array/m-p/988119#M27651</link>
      <description>The missing link is &lt;A href="http://www.wotsit.org" target="_blank"&gt;www.wotsit.org&lt;/A&gt;.</description>
      <pubDate>Thu, 18 Apr 2002 17:39:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/read-bitmap-from-file-to-array/m-p/988119#M27651</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2002-04-18T17:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: read bitmap from file to array</title>
      <link>https://community.intel.com/t5/Software-Archive/read-bitmap-from-file-to-array/m-p/988120#M27652</link>
      <description>I receive the information.  &lt;BR /&gt;Thank you very much for the help. &lt;BR /&gt;OPiedrahita</description>
      <pubDate>Fri, 19 Apr 2002 03:13:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/read-bitmap-from-file-to-array/m-p/988120#M27652</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2002-04-19T03:13:14Z</dc:date>
    </item>
  </channel>
</rss>

