<?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: Win-API function CreateBitmapIndirect in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Win-API-function-CreateBitmapIndirect/m-p/941247#M17057</link>
    <description>Well, the docs on BITMAP say, quote, &lt;BR /&gt; &lt;BR /&gt;&lt;I&gt;The bitmap formats currently used are monochrome and color. The monochrome bitmap uses a one-bit, one-plane format. Each scan is a multiple of 32 bits. &lt;/I&gt; &lt;BR /&gt; &lt;BR /&gt;Maybe it's not true for WinNT/2000, since GDI realizations btw. 9x and &lt;BR /&gt;NT do differ, however, it looks as if you'll have to redesign the code so that &lt;BR /&gt;BM.bmHeight is a multiply of 32. Well, it will require some conversion btw.  &lt;BR /&gt;real image size (in general, not a multiply of 32) and 32-bit based memory representation, but I'm afraid you can't avoid that. &lt;BR /&gt; &lt;BR /&gt;Jugoslav</description>
    <pubDate>Tue, 06 Mar 2001 00:36:27 GMT</pubDate>
    <dc:creator>Jugoslav_Dujic</dc:creator>
    <dc:date>2001-03-06T00:36:27Z</dc:date>
    <item>
      <title>Win-API function CreateBitmapIndirect</title>
      <link>https://community.intel.com/t5/Software-Archive/Win-API-function-CreateBitmapIndirect/m-p/941246#M17056</link>
      <description>Hi folks,  &lt;BR /&gt;  &lt;BR /&gt;I hope there is an expert on Win32 API who could help me with a frustrating problem.  &lt;BR /&gt;  &lt;BR /&gt;I have developed a subroutine which prints a monochrome version of a rectangular section of the screen.  &lt;BR /&gt;  &lt;BR /&gt;A test version of the code runs like this:  &lt;BR /&gt;&lt;OL&gt;&lt;BR /&gt;&lt;LI&gt;Capture the screen using GETIMAGE.  &lt;BR /&gt;&lt;/LI&gt;&lt;LI&gt;Convert the resulting 32-bit bitmap to a monochrome 1-bit bitmap, the DATA PART of which is stored in array IM_1 (i.e no header or RGB colors)  &lt;BR /&gt;&lt;/LI&gt;&lt;LI&gt;Start using Win-32 routines  &lt;BR /&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;BR /&gt;&lt;FONT size="+1"&gt;&lt;BR /&gt;&lt;PRE&gt;
BM.bmType=0      
BM.bmWidth=ICOLTOT      
BM.bmHeight=IROWTOT   
BM.bmWidthBytes=NBYTE_ROW      
BM.bmPlanes=1      
BM.bmBitsPixel=1   
BM.bmBits=LOC(IM_1)   
hBM=CreateBitmapIndirect(BM)	 ! create win-32 bitmap structure  
hDCsc=CreateDC(DISPLAY,char(0),char(0),DV) ! Normal DC for screen  
hDCscComp=CreateCompatibleDC(hDCsc)	   ! memory screen  
IRES=SelectObject(hDCscComp,hBM)    ! select mono bitmap 
! As a test, copy mono image back to the real screen   
ires=BitBlt(hDCsc,100,100,ICOLTOT,IROWTOT,	 
+ hDCscComp,0,0,SRCCOPY) 
&lt;/PRE&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;On  Win NT 4.0 everything works perfectly in all cases.  &lt;BR /&gt;On Win 95 or 98 it only works when the width of the selected screen rectangle is divisible by 32, i.e when no "zero padding" is required in constructing the IM_1 bitmap part.  &lt;BR /&gt;When zero-padding is required, the image is totally "scrambled" showing that the created bitmap is "out of sync".  &lt;BR /&gt;  &lt;BR /&gt;Any suggestions ??? &lt;BR /&gt; &lt;BR /&gt;Thanks &lt;BR /&gt;lars.engstrom@fysik.lu.se</description>
      <pubDate>Mon, 05 Mar 2001 23:39:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Win-API-function-CreateBitmapIndirect/m-p/941246#M17056</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2001-03-05T23:39:18Z</dc:date>
    </item>
    <item>
      <title>Re: Win-API function CreateBitmapIndirect</title>
      <link>https://community.intel.com/t5/Software-Archive/Win-API-function-CreateBitmapIndirect/m-p/941247#M17057</link>
      <description>Well, the docs on BITMAP say, quote, &lt;BR /&gt; &lt;BR /&gt;&lt;I&gt;The bitmap formats currently used are monochrome and color. The monochrome bitmap uses a one-bit, one-plane format. Each scan is a multiple of 32 bits. &lt;/I&gt; &lt;BR /&gt; &lt;BR /&gt;Maybe it's not true for WinNT/2000, since GDI realizations btw. 9x and &lt;BR /&gt;NT do differ, however, it looks as if you'll have to redesign the code so that &lt;BR /&gt;BM.bmHeight is a multiply of 32. Well, it will require some conversion btw.  &lt;BR /&gt;real image size (in general, not a multiply of 32) and 32-bit based memory representation, but I'm afraid you can't avoid that. &lt;BR /&gt; &lt;BR /&gt;Jugoslav</description>
      <pubDate>Tue, 06 Mar 2001 00:36:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Win-API-function-CreateBitmapIndirect/m-p/941247#M17057</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2001-03-06T00:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: Win-API function CreateBitmapIndirect</title>
      <link>https://community.intel.com/t5/Software-Archive/Win-API-function-CreateBitmapIndirect/m-p/941248#M17058</link>
      <description>Hi,Lars again. &lt;BR /&gt; &lt;BR /&gt;I have "solved" the problem - although I don't understand the solution!! &lt;BR /&gt; &lt;BR /&gt;The trick is to make the number of bytes per scan line (row) divisible by TWO (2). Then everyting works on all platforms. &lt;BR /&gt; &lt;BR /&gt;However, every doc on bitmaps I have ever seen, incl SDK, states that you must pad to make the number of bytes divisible by FOUR (4) - word aligned. &lt;BR /&gt; &lt;BR /&gt;I would still be happy if someone could help me understand this</description>
      <pubDate>Wed, 07 Mar 2001 23:37:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Win-API-function-CreateBitmapIndirect/m-p/941248#M17058</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2001-03-07T23:37:31Z</dc:date>
    </item>
  </channel>
</rss>

