<?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 : Using CXTButton with CXTPGraphicBitmapPng</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : General Discussion : Using CXTButton with CXTPGraphicBitmapPng]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Mon, 27 Apr 2026 14:18:49 +0000</pubDate>
  <lastBuildDate>Tue, 26 Jun 2007 01:22:30 +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=7437</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[Using CXTButton with CXTPGraphicBitmapPng : Hello,  You can override virtual...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=7437&amp;PID=23936&amp;title=using-cxtbutton-with-cxtpgraphicbitmappng#23936</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 7437<br /><strong>Posted:</strong> 26 June 2007 at 1:22am<br /><br />Hello,<DIV>&nbsp;</DIV><DIV>You can override virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);<BR>and draw tranparent part as you need.</DIV>]]>
   </description>
   <pubDate>Tue, 26 Jun 2007 01:22:30 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=7437&amp;PID=23936&amp;title=using-cxtbutton-with-cxtpgraphicbitmappng#23936</guid>
  </item> 
  <item>
   <title><![CDATA[Using CXTButton with CXTPGraphicBitmapPng : It&amp;#039;s ok and work fine, how...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=7437&amp;PID=23924&amp;title=using-cxtbutton-with-cxtpgraphicbitmappng#23924</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3085">shobits1</a><br /><strong>Subject:</strong> 7437<br /><strong>Posted:</strong> 25 June 2007 at 5:28pm<br /><br />It's ok and work fine, how ever some area of my PNG&nbsp;image are transparent and I want to make my button transparent&nbsp; in this area too<DIV>is there any method that do it or I must use the <strong>BS_OWNERDRAW </strong>style then define my draw function</DIV>]]>
   </description>
   <pubDate>Mon, 25 Jun 2007 17:28:06 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=7437&amp;PID=23924&amp;title=using-cxtbutton-with-cxtpgraphicbitmappng#23924</guid>
  </item> 
  <item>
   <title><![CDATA[Using CXTButton with CXTPGraphicBitmapPng : Hi, you need 4th method and load...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=7437&amp;PID=23905&amp;title=using-cxtbutton-with-cxtpgraphicbitmappng#23905</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 7437<br /><strong>Posted:</strong> 25 June 2007 at 1:22am<br /><br /><DIV>Hi,</DIV><DIV>you need 4th method and load image using methods of CXTPImageManagerIconHandle/CXTPImageManagerIcon:</DIV><DIV></DIV><DIV></DIV><DIV></DIV><DIV></DIV><FONT color=#990000><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>CXTPImageManagerIconHandle hIconHandle;</DIV><DIV>&nbsp;BOOL bAlphaBitmap = FALSE;<BR>&nbsp;HBITMAP hBitmap = CXTPImageManagerIcon::LoadBitmapFromResource(MAKEINTRESOURCE(nID), &amp;bAlphaBitmap);</DIV><DIV>&nbsp;if (!hBitmap)<BR>&nbsp;&nbsp;return FALSE;</DIV><DIV>&nbsp;if (bAlphaBitmap)<BR>&nbsp;{<BR>&nbsp;&nbsp;hIconHandle = hBitmap; // Will call DeleteObject;<BR>&nbsp;}<BR>&nbsp;else<BR>&nbsp;{<BR>&nbsp;&nbsp;CBitmap bmpIcon;<BR>&nbsp;&nbsp;bmpIcon.Attach(hBitmap);</DIV><DIV>&nbsp;&nbsp;// convert the bitmap to a transparent icon.<BR>&nbsp;&nbsp;HICON hIcon = CXTPTransparentBitmap(bmpIcon).ConvertToIcon();</DIV><DIV>&nbsp;&nbsp;hIconHandle = hIcon; // Will call DestoyIcon;<BR>&nbsp;}</DIV><DIV>&nbsp;if (hIconHandle.IsEmpty())<BR>&nbsp;&nbsp;return FALSE;</DIV><DIV>&nbsp;return CXTButton::SetIcon(size, hIconHandle, CXTPImageManagerIconHandle(), bRedraw);<BR></DIV></FONT>]]>
   </description>
   <pubDate>Mon, 25 Jun 2007 01:22:41 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=7437&amp;PID=23905&amp;title=using-cxtbutton-with-cxtpgraphicbitmappng#23905</guid>
  </item> 
  <item>
   <title><![CDATA[Using CXTButton with CXTPGraphicBitmapPng :  Hello very one,,   I tired...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=7437&amp;PID=23902&amp;title=using-cxtbutton-with-cxtpgraphicbitmappng#23902</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3085">shobits1</a><br /><strong>Subject:</strong> 7437<br /><strong>Posted:</strong> 24 June 2007 at 2:16pm<br /><br /><DIV><DIV dir=ltr style="DIRECTI&#079;N: ltr; LINE-HEIGHT: normal; unicode-bidi: ; TEXT-ALIGN: left">Hello very one,, </DIV><DIV dir=ltr style="DIRECTI&#079;N: ltr; LINE-HEIGHT: normal; unicode-bidi: ; TEXT-ALIGN: left"></DIV><DIV dir=ltr style="MARGIN: 0cm 0cm 10pt; DIRECTI&#079;N: ltr; unicode-bidi: ; TEXT-ALIGN: left">I tired in search for using <FONT color=#990000>CXTButton </FONT>with <FONT color=#990000>CXTPGraphicBitmapPng </FONT>so please help me if you can.</DIV><DIV dir=ltr style="MARGIN: 0cm 0cm 10pt; DIRECTI&#079;N: ltr; unicode-bidi: ; TEXT-ALIGN: left">I know that there are many way to load <FONT color=#990000>CXTButton </FONT>with icon or bitmap, but I want to use PNG image in my <FONT color=#990000>CXTButton</FONT>.</DIV><DIV dir=ltr style="MARGIN: 0cm 0cm 10pt; DIRECTI&#079;N: ltr; unicode-bidi: ; TEXT-ALIGN: left">&nbsp;</DIV><DIV dir=ltr style="MARGIN: 0cm 0cm 10pt; DIRECTI&#079;N: ltr; unicode-bidi: ; TEXT-ALIGN: left"><U>Why should I use it</U>: after the success help of <strong><U>oleg</U></strong> to how draw a PNG image (PNG with alpha layer) correctly &nbsp;(see: <a href="http://forum.codejock.com/forum_posts.asp?TID=7402" target="_blank">http://forum.codejock.com/forum_posts.asp?TID=7402</A> )</DIV><DIV dir=ltr style="MARGIN: 0cm 0cm 10pt; DIRECTI&#079;N: ltr; unicode-bidi: ; TEXT-ALIGN: left">&nbsp;I used it in my own controls, some of these PNG are like icons in size (48x48) so for reduce the size of my resource and help my program to execute rapidly (use the preloaded image in my <FONT color=#990000>CXTPGraphicBitmapPng </FONT>objects), I decided to use these <FONT color=#990000>CXTPGraphicBitmapPng </FONT>but when I try to add it in <FONT color=#990000>CXTButton</FONT>, I fail, the two function used in <FONT color=#990000>CXTButton </FONT>to set icon or image are:</DIV><DIV dir=ltr style=": #dddddd; DIRECTI&#079;N: ltr; LINE-HEIGHT: normal; unicode-bidi: ; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt">BOOL SetBitmap( CSize size, UINT nID, BOOL bRedraw = TRUE);</DIV><DIV dir=ltr style="DIRECTI&#079;N: ltr; LINE-HEIGHT: normal; unicode-bidi: ; TEXT-ALIGN: left">And</DIV><DIV dir=ltr style=": #dddddd; DIRECTI&#079;N: ltr; LINE-HEIGHT: normal; unicode-bidi: ; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt">BOOL SetIcon( CSize size, HICON hIcon, HICON hIconHot = NULL, BOOL bRedraw = TRUE);</DIV><DIV dir=ltr style=": #dddddd; DIRECTI&#079;N: ltr; LINE-HEIGHT: normal; unicode-bidi: ; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt">BOOL SetIcon( CSize size, UINT nID, UINT nHotID = 0, BOOL bRedraw = TRUE);</DIV><DIV dir=ltr style=": #dddddd; DIRECTI&#079;N: ltr; LINE-HEIGHT: normal; unicode-bidi: ; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt">BOOL SetIcon( CSize size, LPCTSTR lpszID, LPCTSTR lpszHotID = NULL, BOOL bRedraw = TRUE);</DIV><DIV dir=ltr style=": #dddddd; DIRECTI&#079;N: ltr; LINE-HEIGHT: normal; unicode-bidi: ; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt">BOOL SetIcon( CSize size, CXTPImageManagerIconHandle hIconHandle, CXTPImageManagerIconHandle hIconHotHandle, BOOL bRedraw = TRUE);</DIV><DIV dir=ltr style="MARGIN: 0cm 0cm 10pt; DIRECTI&#079;N: ltr; unicode-bidi: ; TEXT-ALIGN: left">&nbsp;</DIV><DIV dir=ltr style="MARGIN: 0cm 0cm 10pt; DIRECTI&#079;N: ltr; unicode-bidi: ; TEXT-ALIGN: left">I can't use the first one because my Images are stored externally, so I try with SetIcon (exactly &nbsp;with the last one), I think to convert my <FONT color=#990000>CXTPGraphicBitmapPng </FONT>to <FONT color=#990000>CXTPImageManagerIconHandle</FONT>, or create <FONT color=#990000>CXTPImageManagerIconHandle </FONT>object by using <FONT color=#990000>CXTPGraphicBitmapPng </FONT>as <FONT color=#990000>HBITMAP </FONT>but it can't be helped</DIV><DIV dir=ltr style="MARGIN: 0cm 0cm 10pt; DIRECTI&#079;N: ltr; unicode-bidi: ; TEXT-ALIGN: left">What I want:</DIV><DIV dir=ltr style="MARGIN: 0cm 0cm 10pt 36pt; DIRECTI&#079;N: ltr; TEXT-INDENT: -18pt; unicode-bidi: ; TEXT-ALIGN: left; mso-add-space: auto; mso-list: l0 level1 lfo1">1-&nbsp;&nbsp;&nbsp; If possible how I can set image for <FONT color=#990000>CXTButton </FONT>using <FONT color=#990000>CXTPGraphicBitmapPng</FONT>;</DIV><DIV dir=ltr style="MARGIN: 0cm 0cm 10pt 36pt; DIRECTI&#079;N: ltr; TEXT-INDENT: -18pt; unicode-bidi: ; TEXT-ALIGN: left; mso-add-space: auto; mso-list: l0 level1 lfo1">2-&nbsp;&nbsp;&nbsp; How I can set <FONT color=#990000>CXTButton </FONT>image (this image is PNG sorted externally in Dll file);</DIV><DIV dir=ltr style="MARGIN: 0cm 0cm 10pt 36pt; DIRECTI&#079;N: ltr; TEXT-INDENT: -18pt; unicode-bidi: ; TEXT-ALIGN: left; mso-add-space: auto; mso-list: l0 level1 lfo1">3-&nbsp;&nbsp;&nbsp; How I can create a valid icon with alpha layer using <FONT color=#990000>CXTPGraphicBitmapPng</FONT>;</DIV><DIV dir=ltr style="MARGIN: 0cm 0cm 10pt 36pt; DIRECTI&#079;N: ltr; TEXT-INDENT: -18pt; unicode-bidi: ; TEXT-ALIGN: left; mso-add-space: auto; mso-list: l0 level1 lfo1">4-&nbsp;&nbsp;&nbsp; Is <FONT color=#990000>CXTButton </FONT>support icons with alpha layer, if not how I can use it with these icons;</DIV><DIV dir=ltr style="MARGIN: 0cm 0cm 10pt; DIRECTI&#079;N: ltr; unicode-bidi: ; TEXT-ALIGN: left">Note: all my PNG files are images with alpha layer and sorted in resource file externally this resource file is a Dll file.</DIV><DIV dir=ltr style="MARGIN: 0cm 0cm 10pt; DIRECTI&#079;N: ltr; unicode-bidi: ; TEXT-ALIGN: left">&nbsp;</DIV><DIV dir=ltr style="MARGIN: 0cm 0cm 10pt; DIRECTI&#079;N: ltr; unicode-bidi: ; TEXT-ALIGN: left">Thanks to every one ...</DIV></DIV>]]>
   </description>
   <pubDate>Sun, 24 Jun 2007 14:16:20 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=7437&amp;PID=23902&amp;title=using-cxtbutton-with-cxtpgraphicbitmappng#23902</guid>
  </item> 
 </channel>
</rss>