<?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 : How to load a single .png?</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : How to load a single .png?]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Thu, 23 Apr 2026 00:39:31 +0000</pubDate>
  <lastBuildDate>Mon, 29 Oct 2007 06:32:06 +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=8446</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[How to load a single .png? : Hi,  LoadBitmapFromResource...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=8446&amp;PID=27803&amp;title=how-to-load-a-single-png#27803</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 8446<br /><strong>Posted:</strong> 29 October 2007 at 6:32am<br /><br />Hi,<DIV>&nbsp;</DIV><DIV>LoadBitmapFromResource was added for loading alpha bitmaps. </DIV><DIV>&nbsp;</DIV><DIV>use this way instead</DIV><DIV>&nbsp;</DIV><DIV><DIV>UINT command = ID_2; </DIV><DIV>m_wndTaskPanel.GetImageManager()-&gt;SetIcons( IDB_DEVICE_ICON16, &amp;command,&nbsp;1, CSize(16, 16) );</DIV></DIV>]]>
   </description>
   <pubDate>Mon, 29 Oct 2007 06:32:06 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=8446&amp;PID=27803&amp;title=how-to-load-a-single-png#27803</guid>
  </item> 
  <item>
   <title><![CDATA[How to load a single .png? : Here is the bitmap file:   ...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=8446&amp;PID=27800&amp;title=how-to-load-a-single-png#27800</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3411">poiser</a><br /><strong>Subject:</strong> 8446<br /><strong>Posted:</strong> 29 October 2007 at 5:23am<br /><br />Here is the bitmap file:<br><br><br><a href="uploads/20071029_052255_paste2.zip" target="_blank">uploads/20071029_052255_paste2.zip</a><br><br>I look forward to hearing from you.<br>]]>
   </description>
   <pubDate>Mon, 29 Oct 2007 05:23:43 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=8446&amp;PID=27800&amp;title=how-to-load-a-single-png#27800</guid>
  </item> 
  <item>
   <title><![CDATA[How to load a single .png? : Hi, also attach IDB_DEVICE_ICON16...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=8446&amp;PID=27626&amp;title=how-to-load-a-single-png#27626</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 8446<br /><strong>Posted:</strong> 24 October 2007 at 3:15pm<br /><br />Hi,<DIV>also attach IDB_DEVICE_ICON16 bitmap file</DIV>]]>
   </description>
   <pubDate>Wed, 24 Oct 2007 15:15:37 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=8446&amp;PID=27626&amp;title=how-to-load-a-single-png#27626</guid>
  </item> 
  <item>
   <title><![CDATA[How to load a single .png? :      Unfortunately the project...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=8446&amp;PID=27622&amp;title=how-to-load-a-single-png#27622</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3411">poiser</a><br /><strong>Subject:</strong> 8446<br /><strong>Posted:</strong> 24 October 2007 at 10:31am<br /><br />Unfortunately the project is too large to attach, even when zipped.<br>However I attach the file the most relevant files so you can at least see what's happening.<br>Your suggestion that I am doing something wrong is probably right because I only started using codejock this week!<br><br>The file that contains the code which loads the images <font color="#0000ff">is MainFrm.cpp</font>, <font color="#0000ff">line </font><font color="#006633"><font color="#0000ff">255</font> </font>where it says <font color="#0000ff">"Test 3"</font>.<br><br>Cheers <img src="http://forum.codejock.com/smileys/smiley4.gif" border="0" align="absmiddle"><br><br><a href="uploads/20071024_111058_Files.zip" target="_blank">uploads/20071024_111058_Files.zip</a><br><br>Bitmap/PNG files are located in this directory, including IDB_DEVICE_ICON16 bitmap file:<br><a href="uploads/20071025_043213_res.zip" target="_blank">uploads/20071025_043213_res.zip</a><br>]]>
   </description>
   <pubDate>Wed, 24 Oct 2007 10:31:50 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=8446&amp;PID=27622&amp;title=how-to-load-a-single-png#27622</guid>
  </item> 
  <item>
   <title><![CDATA[How to load a single .png? : poiser, attach your project. Obviously...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=8446&amp;PID=27589&amp;title=how-to-load-a-single-png#27589</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 8446<br /><strong>Posted:</strong> 23 October 2007 at 2:55pm<br /><br /><a href="https://forum.codejock.com/member_profile.asp?PF=3411&amp;FID=18" target="_blank"><strong><FONT color=#000000>poiser</FONT></strong></A>,&nbsp; attach your project. Obviously you do something wrong.]]>
   </description>
   <pubDate>Tue, 23 Oct 2007 14:55:42 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=8446&amp;PID=27589&amp;title=how-to-load-a-single-png#27589</guid>
  </item> 
  <item>
   <title><![CDATA[How to load a single .png? : I&amp;#039;m out of ideas too.. sorry....]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=8446&amp;PID=27587&amp;title=how-to-load-a-single-png#27587</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3350">Jayonas</a><br /><strong>Subject:</strong> 8446<br /><strong>Posted:</strong> 23 October 2007 at 11:40am<br /><br />I'm out of ideas too.. sorry. :(  Maybe oleg or someone else will come along with something to try.]]>
   </description>
   <pubDate>Tue, 23 Oct 2007 11:40:37 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=8446&amp;PID=27587&amp;title=how-to-load-a-single-png#27587</guid>
  </item> 
  <item>
   <title><![CDATA[How to load a single .png? : I loaded a 32x32 .bmp and it didn&amp;#039;t...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=8446&amp;PID=27586&amp;title=how-to-load-a-single-png#27586</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3411">poiser</a><br /><strong>Subject:</strong> 8446<br /><strong>Posted:</strong> 23 October 2007 at 11:37am<br /><br />I loaded a 32x32 .bmp and it didn't work.<br><br>I don't know what to try now!<br>]]>
   </description>
   <pubDate>Tue, 23 Oct 2007 11:37:59 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=8446&amp;PID=27586&amp;title=how-to-load-a-single-png#27586</guid>
  </item> 
  <item>
   <title><![CDATA[How to load a single .png? : Cheers Jahonas,I just tried out...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=8446&amp;PID=27585&amp;title=how-to-load-a-single-png#27585</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3411">poiser</a><br /><strong>Subject:</strong> 8446<br /><strong>Posted:</strong> 23 October 2007 at 11:08am<br /><br />Cheers Jahonas,<br><br>I just tried out ur suggestions. LoadBitmapFromResource does return something and SetIcon return true.<br><br>I will try and investigate further by loading exactly a 32x32 image and see if that yield s any results.<br><br>]]>
   </description>
   <pubDate>Tue, 23 Oct 2007 11:08:20 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=8446&amp;PID=27585&amp;title=how-to-load-a-single-png#27585</guid>
  </item> 
  <item>
   <title><![CDATA[How to load a single .png? : Ugh, there was a slight error...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=8446&amp;PID=27580&amp;title=how-to-load-a-single-png#27580</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3350">Jayonas</a><br /><strong>Subject:</strong> 8446<br /><strong>Posted:</strong> 23 October 2007 at 10:50am<br /><br />Ugh, there was a slight error in my code, although it doesn't explain your problem.  The variable "A" being passed to the function should have been "&amp;Alpha".  The HTML thought that the &amp; symbol meant something else.  I've corrected my original post.  As best as I understand, that boolean is not an indication of success or failure, but of whether or not the loaded PNG uses an alpha channel.<br /><br />As far as why the image doesn't display.. I'm not sure.  I know that code has been working for me.  Is the PNG in question actually 16x16?  I'm not sure what it would do if the size you give it doesn't match the size of the image.  You could check the return value of both LoadBitmapFromResource and SetIcon to see if either returns an error value.  If one of them does, you could step into the loading code in the debugger to find out where and why it's failing.<br /><br />If they return successful values, I'd guess there was something wrong with how the image is used in the TaskPanel, but I'm completely unfamiliar with TaskPanels, so I have no idea what that problem might be.  My only wild guess would be that the TaskPanel might be looking for a 32x32 or some other sized icon to display and the ImageManager only has the 16x16 one loaded.<br /><br />Good luck. :)]]>
   </description>
   <pubDate>Tue, 23 Oct 2007 10:50:31 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=8446&amp;PID=27580&amp;title=how-to-load-a-single-png#27580</guid>
  </item> 
  <item>
   <title><![CDATA[How to load a single .png? :     Jayonas wrote:ImageManager...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=8446&amp;PID=27576&amp;title=how-to-load-a-single-png#27576</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3411">poiser</a><br /><strong>Subject:</strong> 8446<br /><strong>Posted:</strong> 23 October 2007 at 10:34am<br /><br /><table width="99%"><tr><td class="BBquote"><img src="forum_images/quote_box.png" title="Originally posted by Jayonas" alt="Originally posted by Jayonas" style="vertical-align: text-bottom;" /> <strong>Jayonas wrote:</strong><br /><br />ImageManager includes a SetIcon method that I've been using to successfully load single images (including PNGs).<br><br><table width="99%"><tr><td><pre class="BBcode"><br>BOOL Alpha;<br>this-&gt;GetCommandBars()-&gt;GetImageManager()-&gt;SetIcon(CXTPImageManagerIcon::LoadBitmapFromResource(MAKEINTRESOURCE(ResourceID), &#913;), CommandID, Size, State);<br></pre></td></tr></table><br><br>You can also load them from files by using LoadBitmapFromFile instead of LoadBitmapFromResource.</td></tr></table><br><br>I tried the following code above but modified to suit my needs (code below). It compiles and runs fine but the image/icon is not displayed.<br>When i checked the value of A at runtime it was false meaning that loading the .png failed. Can somebody tell me why?<br><br><table width="99%"><tr><td><pre class="BBcode"><br><font color="#0000ff">UINT </font>command2;<br>command2 = <font color="#006666">ID_2</font>;<br><font color="#0000ff">BOOL </font>A;<br>m_wndTaskPanel.GetImageManager()-&gt;SetIcon(CXTPImageManagerIcon::LoadBitmapFromResource(MAKEINTRESOURCE(<font color="#006666">IDP_DEVICE_PRINT</font>), &amp;A), <font color="#000000">command2</font>, CSize(<font color="#ff0000">16</font>,<font color="#ff0000">16</font>), xtpImageNormal);<br>CXTPTaskPanelGroupItem* pItem3 = pGroup-&gt;AddLinkItem(<font color="#ff0000">3</font>, <font color="#ff0000">ID_2</font>);<br></pre></td></tr></table><br><br><font color="#006666">IDP_DEVICE_PRINT</font> is defined in the .rc as follows:<br><table width="99%"><tr><td><pre class="BBcode"><br><font color="#006666">IDP_DEVICE_PRINT</font>&nbsp;&nbsp;&nbsp; PNG&nbsp;&nbsp; MOVEABLE&nbsp;&nbsp; PURE&nbsp;&nbsp;&nbsp; &nbsp;<font color="#ff0000">"C:\\Dev\\print.png"</font><br></pre></td></tr></table><br><br>p.s.: all suggestions are welcome!<br><br>]]>
   </description>
   <pubDate>Tue, 23 Oct 2007 10:34:17 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=8446&amp;PID=27576&amp;title=how-to-load-a-single-png#27576</guid>
  </item> 
 </channel>
</rss>