<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : CXTPImageManager::ResampleAlphaLayer Correction</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : CXTPImageManager::ResampleAlphaLayer Correction]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Mon, 20 Apr 2026 19:41:28 +0000</pubDate>
  <lastBuildDate>Tue, 13 Sep 2011 14:33:33 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=18822</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[CXTPImageManager::ResampleAlphaLayer Correction :              Oleg...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=18822&amp;PID=66280&amp;title=cxtpimagemanagerresamplealphalayer-correction#66280</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6515">tomay3000</a><br /><strong>Subject:</strong> 18822<br /><strong>Posted:</strong> 13 September 2011 at 2:33pm<br /><br /><table width="99%"><tr><td class="BBquote"><img src="forum_images/quote_box.png" title="Originally posted by Oleg" alt="Originally posted by Oleg" style="vertical-align: text-bottom;" /> <strong>Oleg wrote:</strong><br /><br />Hi,<div><br></div><div>Thanks, I see. Will review this code.</div></td></tr></table><br><br>I have seen your code in <b>CXTPImageManager::ResampleAlphaLayer</b> function of the <b>Codejock ToolkitPro MFC v15.1.3.0908</b> &amp; this is what I would like to say:<br><font size="3"><br><font size="5"><b>First:</b></font></font><br>This is the true, global &amp; final math formula used in re-sampling <b>32bit alpha bitmaps</b> to <b>24bit bitmaps</b>. I have been working last night to find it.<br><img src="uploads/6515/ResampleAlphaLayer.jpg" border="0" /><br><br><font size="5"><b>Second:</b></font><br><br>In your code you used this:<br><b>pTarget&#091;0&#093; = (BYTE)((pSource&#091;0&#093; * (255 - iAlpha) + pSource&#091;0&#093; * iAlpha) &gt;&gt; 8);<br>pTarget&#091;1&#093; = (BYTE)((pSource&#091;1&#093; * (255 - iAlpha) + pSource&#091;1&#093; * iAlpha) &gt;&gt; 8);<br>pTarget&#091;2&#093; = (BYTE)((pSource&#091;2&#093; * (255 - iAlpha) + pSource&#091;2&#093; * iAlpha) &gt;&gt; 8);<br><br>And as known:<br><br>(<font color="#FF0000">x</font> * <font color="#00FF00">y</font>) + (<font color="#FF0000">x</font> * <font color="#0000FF">z</font>) = <font color="#FF0000">x</font> * (<font color="#00FF00">y</font> + <font color="#0000FF">z</font>)<br><br>So,</b> your code is the same as the below:<br><b><br>pTarget&#091;0&#093; = (BYTE)((pSource&#091;0&#093; * 255) &gt;&gt; 8);<br>pTarget&#091;1&#093; = (BYTE)((pSource&#091;1&#093; * 255) &gt;&gt; 8);<br>pTarget&#091;2&#093; = (BYTE)((pSource&#091;2&#093; * 255) &gt;&gt; 8);<br><font size="3"><br><font size="5">Third:</font></font></b><br><br><b>R G B</b> &amp; <b>A</b> values of a bitmap are stored in like this: <b><font color="#0000FF">B</font><font color="#00FF00">G</font><font color="#FF0000">R</font>A</b><b> </b><b><font color="#0000FF">B</font><font color="#00FF00">G</font><font color="#FF0000">R</font>A</b><b><font color="#0000FF"> B</font><font color="#00FF00">G</font><font color="#FF0000">R</font>A</b><b> </b><b><font color="#0000FF">B</font><font color="#00FF00">G</font><font color="#FF0000">R</font>A </b><b><font color="#0000FF">B</font><font color="#00FF00">G</font><font color="#FF0000">R</font>A </b><b>...</b><br>and not <b><font color="#FF0000">R</font></b><b><font color="#00FF00">G</font></b><b><font color="#0000FF">B</font></b><b>A</b> as you did. (You confused <font color="#FF0000"><b>Red</b></font> with <font color="#0000FF"><b>Blue</b></font>).<br><br><font size="5"><b>Fourth:</b></font><br><br>This is the last <b>CXTPImageManager::ResampleAlphaLayer</b> function that should be:<br><b></b><br><b>HBITMAP CXTPImageManager::ResampleAlphaLayer(HBITMAP hBitmapAlpha, COLORREF clrMask)<br>{<br>&nbsp;&nbsp;&nbsp; LPBYTE lpbytBits = NULL;<br>&nbsp;&nbsp;&nbsp; LPBITMAPINFO lpBitmapInfo = NULL;<br>&nbsp;&nbsp;&nbsp; UINT uiSize;<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; if (!CXTPImageManagerIcon::GetBitmapBits(*CDC::FromHandle(::CreateCompatibleDC(NULL)), hBitmapAlpha, lpBitmapInfo, (LPVOID&amp;)lpbytBits, uiSize))<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return NULL;<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; LPBYTE lpbytTarget = NULL;<br>&nbsp;&nbsp;&nbsp; LPBYTE lpbytSource = lpbytBits;<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; lpBitmapInfo-&gt;bmiHeader.biBitCount = 24;<br>&nbsp;&nbsp;&nbsp; lpBitmapInfo-&gt;bmiHeader.biCompression = BI_RGB;<br>&nbsp;&nbsp;&nbsp; lpBitmapInfo-&gt;bmiHeader.biSizeImage = 0;<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; HBITMAP hBitmapResult = ::CreateDIBSection(::CreateCompatibleDC(NULL), lpBitmapInfo, DIB_RGB_COLORS, (LPVOID *)&amp;lpbytTarget, NULL, 0);<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; if (lpbytTarget &amp;&amp; lpbytSource &amp;&amp; hBitmapResult)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for (int i = 0; i &lt; lpBitmapInfo-&gt;bmiHeader.biHeight; i ++)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for (int j = 0; j &lt; lpBitmapInfo-&gt;bmiHeader.biWidth; j ++)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br><font size="3"><font color="#0000FF">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; lpbytTarget&#091;0&#093; = (BYTE)(GetBValue(clrMask) + lpbytSource&#091;3&#093; * (lpbytSource&#091;0&#093; - GetBValue(clrMask)) / 255);</font><br><font color="#00FF00">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; lpbytTarget&#091;1&#093; = (BYTE)(GetGValue(clrMask) + lpbytSource&#091;3&#093; * (lpbytSource&#091;1&#093; - GetGValue(clrMask)) / 255);</font><br><font color="#FF0000">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; lpbytTarget&#091;2&#093; = (BYTE)(GetRValue(clrMask) + lpbytSource&#091;3&#093; * (lpbytSource&#091;2&#093; - GetRValue(clrMask)) / 255);</font></font><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; lpbytTarget += 3;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; lpbytSource += 4;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; lpbytTarget += <font size="3" color="#FF0000">-(lpBitmapInfo-&gt;bmiHeader.biWidth * 3) &amp; 3;</font><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; FREE(lpbytBits);<br>&nbsp;&nbsp;&nbsp; FREE(lpBitmapInfo);<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; return hBitmapResult;<br>}</b><br><br><div><strong></strong><font size="5"><b>Fifth:</b></font><br><br></div>This is a result of the comparison of an image and some variable masks.<br><b>Original Image:</b><br><img src="uploads/6515/home_256.png" height="256" width="256" border="0" /><br><br><b>Mask = RGB(255, 255, 255)<br><img src="uploads/6515/home_256_RGB255_255_255.png" height="256" width="256" border="0" />&nbsp;&nbsp; <img src="uploads/6515/home_256_RGB255_255_255_2.png" height="256" width="256" border="0" /><br><br></b><b>Mask = RGB(255, 0, 0)</b><br><img src="uploads/6515/home_256_RGB255_0_0.png" height="256" width="256" border="0" />&nbsp;&nbsp; <img src="uploads/6515/home_256_RGB255_0_0_2.png" height="256" width="256" border="0" /><br><br><b>Mask = RGB(0, 255, 0)</b><br><b><img src="uploads/6515/home_256_RGB0_255_0.png" height="256" width="256" border="0" />&nbsp;&nbsp; <img src="uploads/6515/home_256_RGB0_255_0_2.png" height="256" width="256" border="0" /><br></b><b><br>Mask = RGB(0, 0, </b><b>255</b><b>)</b><br><b><img src="uploads/6515/home_256_RGB0_0_255.png" height="256" width="256" border="0" />&nbsp;&nbsp; <img src="uploads/6515/home_256_RGB0_0_255_2.png" height="256" width="256" border="0" /><br><br>&amp; <font size="5">Finally:</font><br><br><font size="3">Thank you for your understand &amp; <font size="5">PLEASE</font> do this fix in the next hotfix <img src="http://forum.codejock.com/smileys/smiley2.gif" border="0" alt="Wink" title="Wink" /></font></b><br>]]>
   </description>
   <pubDate>Tue, 13 Sep 2011 14:33:33 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=18822&amp;PID=66280&amp;title=cxtpimagemanagerresamplealphalayer-correction#66280</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPImageManager::ResampleAlphaLayer Correction :    Oleg wrote:Hi,Thanks, I see....]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=18822&amp;PID=66034&amp;title=cxtpimagemanagerresamplealphalayer-correction#66034</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6515">tomay3000</a><br /><strong>Subject:</strong> 18822<br /><strong>Posted:</strong> 24 August 2011 at 8:46pm<br /><br /><table width="99%"><tr><td class="BBquote"><img src="forum_images/quote_box.png" title="Originally posted by Oleg" alt="Originally posted by Oleg" style="vertical-align: text-bottom;" /> <strong>Oleg wrote:</strong><br /><br />Hi,<div><br></div><div>Thanks, I see. Will review this code.</div></td></tr></table><br>welcome<br>]]>
   </description>
   <pubDate>Wed, 24 Aug 2011 20:46:00 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=18822&amp;PID=66034&amp;title=cxtpimagemanagerresamplealphalayer-correction#66034</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPImageManager::ResampleAlphaLayer Correction : Hi,Thanks, I see. Will review...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=18822&amp;PID=66014&amp;title=cxtpimagemanagerresamplealphalayer-correction#66014</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 18822<br /><strong>Posted:</strong> 24 August 2011 at 8:41am<br /><br />Hi,<div><br></div><div>Thanks, I see. Will review this code.</div>]]>
   </description>
   <pubDate>Wed, 24 Aug 2011 08:41:46 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=18822&amp;PID=66014&amp;title=cxtpimagemanagerresamplealphalayer-correction#66014</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPImageManager::ResampleAlphaLayer Correction :    Oleg wrote:Thanks, actually...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=18822&amp;PID=65924&amp;title=cxtpimagemanagerresamplealphalayer-correction#65924</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6515">tomay3000</a><br /><strong>Subject:</strong> 18822<br /><strong>Posted:</strong> 15 August 2011 at 2:24pm<br /><br /><table width="99%"><tr><td class="BBquote"><img src="forum_images/quote_box.png" title="Originally posted by Oleg" alt="Originally posted by Oleg" style="vertical-align: text-bottom;" /> <strong>Oleg wrote:</strong><br /><br />Thanks, actually Resample is obsolete function now - was added when ImageManager didn't support alpha images in Win9x. &nbsp;Now you can draw alpha bitmap in all OS, so you don't need call Resample.</td></tr></table><br><br>I think you are wrong about this. The problem depends on the printer capability.<br>Because some printer devices doesn't support alpha-blending, so the use of <br><h1>CXTPImageManager::ResampleAlphaLayer</h1> is still needed. I have faced this problem when printing on an A4 paper.<br><img src="http://forum.codejock.com/smileys/smiley20.gif" border="0" alt="Thumbs Up" title="Thumbs Up" /><br>]]>
   </description>
   <pubDate>Mon, 15 Aug 2011 14:24:09 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=18822&amp;PID=65924&amp;title=cxtpimagemanagerresamplealphalayer-correction#65924</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPImageManager::ResampleAlphaLayer Correction : Thanks, actually Resample is obsolete...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=18822&amp;PID=65914&amp;title=cxtpimagemanagerresamplealphalayer-correction#65914</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 18822<br /><strong>Posted:</strong> 15 August 2011 at 2:51am<br /><br />Thanks, actually Resample is obsolete function now - was added when ImageManager didn't support alpha images in Win9x. &nbsp;Now you can draw alpha bitmap in all OS, so you don't need call Resample.]]>
   </description>
   <pubDate>Mon, 15 Aug 2011 02:51:50 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=18822&amp;PID=65914&amp;title=cxtpimagemanagerresamplealphalayer-correction#65914</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPImageManager::ResampleAlphaLayer Correction :    Inside .h file//HBITMAP...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=18822&amp;PID=65900&amp;title=cxtpimagemanagerresamplealphalayer-correction#65900</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6515">tomay3000</a><br /><strong>Subject:</strong> 18822<br /><strong>Posted:</strong> 12 August 2011 at 9:29pm<br /><br /><b><font size="5">Inside .h file</font></b><br><font color="#006600">//HBITMAP ResampleAlphaLayer(HBITMAP bmpAlpha, COLORREF clrMask = RGB(255, 255, 255));</font><br><b><br><font size="5">Inside .cpp file</font></b><br><font color="#006600">/*HBITMAP ResampleAlphaLayer(HBITMAP bmpAlpha, COLORREF clrMask)<br>{<br>&nbsp;&nbsp;&nbsp; CDC dcSrc;<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; dcSrc.CreateCompatibleDC(NULL);<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; LPBYTE pBits = NULL;<br>&nbsp;&nbsp;&nbsp; LPBITMAPINFO pBitmapInfo = NULL;<br>&nbsp;&nbsp;&nbsp; UINT nSize;<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; if (!CXTPImageManagerIcon::GetBitmapBits(dcSrc, bmpAlpha, pBitmapInfo, (LPVOID&amp;)pBits, nSize))<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return NULL;<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; LPBYTE pTarget = NULL;<br>&nbsp;&nbsp;&nbsp; LPBYTE pSource = pBits;<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; pBitmapInfo-&gt;bmiHeader.biBitCount = 24;<br>&nbsp;&nbsp;&nbsp; pBitmapInfo-&gt;bmiHeader.biSizeImage = 0;<br>&nbsp;&nbsp;&nbsp; pBitmapInfo-&gt;bmiHeader.biCompression = BI_RGB;<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; HBITMAP hBitmapResult = CreateDIBSection(dcSrc, pBitmapInfo, DIB_RGB_COLORS, (LPVOID*)&amp;pTarget, NULL, 0);<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; if (pTarget &amp;&amp; pSource &amp;&amp; hBitmapResult)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for (int i = 0; i &lt; pBitmapInfo-&gt;bmiHeader.biHeight; i ++)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for (int j = 0; j &lt; pBitmapInfo-&gt;bmiHeader.biWidth; j ++)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; BYTE bytAlpha = pSource&#091;3&#093;;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (bytAlpha == 0) // Transparent<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pTarget&#091;0&#093; = GetBValue(clrMask);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pTarget&#091;1&#093; = GetGValue(clrMask);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pTarget&#091;2&#093; = GetRValue(clrMask);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else if (bytAlpha == 255) // Opaque<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pTarget&#091;0&#093; = pSource&#091;0&#093;;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pTarget&#091;1&#093; = pSource&#091;1&#093;;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pTarget&#091;2&#093; = pSource&#091;2&#093;;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else // Semitransparent<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pTarget&#091;0&#093; = (BYTE)(abs(GetBValue(clrMask) - pSource&#091;0&#093;) * (255 - bytAlpha) / 255);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pTarget&#091;1&#093; = (BYTE)(abs(GetGValue(clrMask) - pSource&#091;1&#093;) * (255 - bytAlpha) / 255);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pTarget&#091;2&#093; = (BYTE)(abs(GetRValue(clrMask) - pSource&#091;2&#093;) * (255 - bytAlpha) / 255);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pTarget += 3;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pSource += 4;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (pBitmapInfo-&gt;bmiHeader.biWidth % 2)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pTarget ++;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; FREE(pBits);<br>&nbsp;&nbsp;&nbsp; FREE(pBitmapInfo);<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; return hBitmapResult;<br>}*/</font><br><br><img src="http://forum.codejock.com/smileys/smiley20.gif" border="0" alt="Thumbs Up" title="Thumbs Up" /><br>]]>
   </description>
   <pubDate>Fri, 12 Aug 2011 21:29:10 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=18822&amp;PID=65900&amp;title=cxtpimagemanagerresamplealphalayer-correction#65900</guid>
  </item> 
 </channel>
</rss>