<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://www.newlc.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>NewLC - CImageDecoder / *.png - Comments</title>
 <link>http://www.newlc.com/forum/cimagedecoder-png</link>
 <description>Comments for &quot;CImageDecoder / *.png&quot;</description>
 <language>en</language>
<item>
 <title>Re: CImageDecoder / *.png</title>
 <link>http://www.newlc.com/forum/cimagedecoder-png#comment-45532</link>
 <description>&lt;p&gt;Late reply, and you probably have fixed this already, but you have to wait for the conversion to finish too.&lt;/p&gt;

&lt;p&gt;Convert is an  asynchronous call, and probably you try draw it before it is done converting the image.&lt;/p&gt;

&lt;p&gt;a call to User::WaitForRequest(ReqStat); after the call to convert will block your thread until it is done.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
 <pubDate>Thu, 03 Apr 2008 14:23:08 +0200</pubDate>
 <dc:creator>alh</dc:creator>
 <guid isPermaLink="false">comment 45532 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: CImageDecoder / *.png</title>
 <link>http://www.newlc.com/forum/cimagedecoder-png#comment-44919</link>
 <description>&lt;p&gt;made some progress after the holiday, but still no png on the screen...&lt;br /&gt;
this is what i&#039;m doing (in AppView::ConstructL for the moment, will be placing it elsewhere at some point) :&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;_LIT(Filename,&amp;quot;c:\\map.png&amp;quot;);&lt;br /&gt;_LIT8(Mime,&amp;quot;image/png&amp;quot;);&lt;br /&gt;RFs Fs;&lt;br /&gt;User::LeaveIfError( Fs.Connect() );&lt;br /&gt;CImageDecoder* ImageDecoder;&lt;br /&gt;TRAPD(err, ImageDecoder = CImageDecoder::FileNewL( Fs, Filename, Mime, CImageDecoder::EOptionNone ) );&lt;br /&gt;if (err != KErrNone)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Fs.Close();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // die&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;Fs.Close();&lt;br /&gt;iMappi = new (ELeave) CFbsBitmap;&lt;br /&gt;err2 = iMappi-&amp;gt;Create(ImageDecoder-&amp;gt;FrameInfo().iOverallSizeInPixels, ImageDecoder-&amp;gt;FrameInfo().iFrameDisplayMode );&lt;br /&gt;TRequestStatus ReqStat;&lt;br /&gt;ImageDecoder-&amp;gt;Convert(&amp;amp;ReqStat,*iMappi);&lt;br /&gt;if (ReqStat != KErrNone)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TInt asdf; // just for debugging&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/code&gt;&lt;/div&gt;&lt;br /&gt;
and then i use gc.BitBlt(TPoint(0,0),iMappi); to draw it (in AppView::Draw)&lt;br /&gt;
it seems that the Convert method isn&#039;t doing anything - regardless of whether i comment it out or not, the program prints me a blank white rectangle of the size of the .png file, and it returns KErrNone (doesn&#039;t go to TInt asdf;)&lt;/p&gt;</description>
 <pubDate>Wed, 05 Mar 2008 10:33:32 +0100</pubDate>
 <dc:creator>Kerpele</dc:creator>
 <guid isPermaLink="false">comment 44919 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: CImageDecoder / *.png</title>
 <link>http://www.newlc.com/forum/cimagedecoder-png#comment-44778</link>
 <description>&lt;p&gt;ah of course i forgot the library, works now, thanks &lt;img src=&quot;/sites/all/modules/smileys/packs/example/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; /&gt;&lt;/p&gt;

&lt;p&gt;i didn&#039;t include error handling and such in the post just to keep it simple, since it only protects against runtime errors and doesn&#039;t affect the compiling (as far as i know), i&#039;ll obviously be adding those &lt;img src=&quot;/sites/all/modules/smileys/packs/example/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; /&gt;&lt;/p&gt;</description>
 <pubDate>Tue, 26 Feb 2008 11:15:38 +0100</pubDate>
 <dc:creator>Kerpele</dc:creator>
 <guid isPermaLink="false">comment 44778 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: CImageDecoder / *.png</title>
 <link>http://www.newlc.com/forum/cimagedecoder-png#comment-44777</link>
 <description>&lt;p&gt;Oh, didn&#039;t notice you didn&#039;t have the * there, ofcourse its needed &lt;img src=&quot;/sites/all/modules/smileys/packs/example/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; /&gt;&lt;br /&gt;
I think you might need to get a C++ book, and a basic symbian book and read through...&lt;br /&gt;
Your next step before this is proper symbian code is to add error and resource handling with cleanupstack and protect against leaves.&lt;/p&gt;

&lt;p&gt;Your new error is a link error because you havn&#039;t included the library in the mmp file.&lt;br /&gt;
you need to add a line to it:&lt;/p&gt;

&lt;p&gt;LIBRARY imageconversion.lib&lt;br /&gt;
&lt;/p&gt;</description>
 <pubDate>Tue, 26 Feb 2008 11:09:18 +0100</pubDate>
 <dc:creator>alh</dc:creator>
 <guid isPermaLink="false">comment 44777 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: CImageDecoder / *.png</title>
 <link>http://www.newlc.com/forum/cimagedecoder-png#comment-44776</link>
 <description>&lt;p&gt;that gives me:&lt;br /&gt;
illegal implicit conversion from &#039;CImageDecoder *&#039; to&lt;/p&gt;

&lt;p&gt;and if i add a * : CImageDecoder* ImageDecoder = ....&lt;br /&gt;
i get the following:&lt;br /&gt;
Undefined symbol: &#039;class CImageDecoder * CImageDecoder::FileNewL(class RFs &amp;, class TDesC16 const &amp;, class TDesC8 const &amp;, enum CImageDecoder::TOptions) (?FileNewL@CImageDecoder@@SAPAV1@AAVRFs@@ABVTDesC16@@ABVTDesC8@@W4TOptions@1@@Z)&#039;[]&lt;/p&gt;

&lt;p&gt;&#039;least it&#039;s a different error &lt;img src=&quot;/sites/all/modules/smileys/packs/example/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; /&gt;&lt;/p&gt;</description>
 <pubDate>Tue, 26 Feb 2008 11:03:21 +0100</pubDate>
 <dc:creator>Kerpele</dc:creator>
 <guid isPermaLink="false">comment 44776 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: CImageDecoder / *.png</title>
 <link>http://www.newlc.com/forum/cimagedecoder-png#comment-44774</link>
 <description>&lt;p&gt;oh, you shouldn&#039;t have an &amp; on any of them.&lt;/p&gt;

&lt;p&gt;The &amp; in the function declaration just means it will take a reference to the object instead of doing a copy. (basic C++ stuff)&lt;/p&gt;

&lt;p&gt;Try this:&lt;br /&gt;
&lt;pre class=&quot;bb-code-block&quot;&gt;
RFs Fss;
Fss.Connect();
_LIT(Filename,&quot;map.png&quot;);
_LIT8(Mime,&quot;image/png&quot;);  //This needs to be an 8 bit descriptor for some reason...
CImageDecoder ImageDecoder = CImageDecoder::FileNewL( Fss, Filename, Mime, CImageDecoder::EOptionNone );
&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;Also, if you are writing an application, you can get a reference to the current file server session (already opened by the framework) by calling&lt;/p&gt;

&lt;p&gt;&lt;pre class=&quot;bb-code-block&quot;&gt;
CCoeEnv::Static()-&amp;gt;FsSession()
&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;or..  if your code is within a CCoeControl class, you can get it even quicker by&lt;/p&gt;

&lt;p&gt;&lt;pre class=&quot;bb-code-block&quot;&gt;
iCoeEnv-&amp;gt;FsSession()
&lt;/pre&gt;&lt;br /&gt;
&lt;/p&gt;</description>
 <pubDate>Tue, 26 Feb 2008 10:58:38 +0100</pubDate>
 <dc:creator>alh</dc:creator>
 <guid isPermaLink="false">comment 44774 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: CImageDecoder / *.png</title>
 <link>http://www.newlc.com/forum/cimagedecoder-png#comment-44770</link>
 <description>&lt;p&gt;still getting the same story with the following:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;RFs Fss;&lt;br /&gt;Fss.Connect();&lt;br /&gt;_LIT(Filename,&amp;quot;map.png&amp;quot;);&lt;br /&gt;_LIT(Mime,&amp;quot;image/png&amp;quot;);&lt;br /&gt;CImageDecoder ImageDecoder = CImageDecoder::FileNewL( Fss, &amp;amp;Filename, &amp;amp;Mime, CImageDecoder::EOptionNone );&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;out of the error messages, this is the one i&#039;m trying to accomplish: (first one in the sdk help)&lt;br /&gt;
CImageDecoder::FileNewL(RFs &amp;, const TDesC16 &amp;, const TDesC8 &amp;, const CImageDecoder::TOptions)&lt;/p&gt;</description>
 <pubDate>Tue, 26 Feb 2008 10:41:36 +0100</pubDate>
 <dc:creator>Kerpele</dc:creator>
 <guid isPermaLink="false">comment 44770 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: CImageDecoder / *.png</title>
 <link>http://www.newlc.com/forum/cimagedecoder-png#comment-44769</link>
 <description>&lt;p&gt;That means there is some mismatch in argument types.&lt;br /&gt;
If you read it, it will actually tell you exactly what the problem is (though can be hard to interpret without good C++ knowledge)&lt;/p&gt;

&lt;p&gt;Maybe because those strange const strings you have tried to declare.&lt;/p&gt;

&lt;p&gt;A much better way to declare those would be with the _LIT macro:&lt;/p&gt;

&lt;p&gt;_LIT(FileName,&quot;map.png&quot;);&lt;br /&gt;
_LIT(Mime,&quot;image/png&quot;);&lt;/p&gt;

&lt;p&gt;Try that first...&lt;/p&gt;

&lt;p&gt;Oh.. also, you should not have the &amp; on the Fss...&lt;/p&gt;</description>
 <pubDate>Tue, 26 Feb 2008 10:36:16 +0100</pubDate>
 <dc:creator>alh</dc:creator>
 <guid isPermaLink="false">comment 44769 at http://www.newlc.com</guid>
</item>
<item>
 <title>CImageDecoder / *.png</title>
 <link>http://www.newlc.com/forum/cimagedecoder-png</link>
 <description>&lt;p&gt;i&#039;m trying to bring a png pic into my project, but ran into a world of trouble with the CImageDecoder class... this is what i tried to do:&lt;/p&gt;

&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;RFs Fss;&lt;br /&gt;Fss.Connect();&lt;br /&gt;const TBufC&amp;lt;16&amp;gt; Filename = _L(&amp;quot;map.png&amp;quot;);&lt;br /&gt;const TBufC&amp;lt;8&amp;gt; Mime = _L(&amp;quot;image/png&amp;quot;);&lt;br /&gt;CImageDecoder ImageDecoder =&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CImageDecoder::FileNewL( &amp;amp;Fss, &amp;amp;Filename, &amp;amp;Mime, CImageDecoder::EOptionNone );&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.newlc.com/forum/cimagedecoder-png&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.newlc.com/forum/cimagedecoder-png#comments</comments>
 <category domain="http://www.newlc.com/forums/2d-3d-graphics">Bitmaps and Graphics</category>
 <pubDate>Tue, 26 Feb 2008 10:30:56 +0100</pubDate>
 <dc:creator>Kerpele</dc:creator>
 <guid isPermaLink="false">20358 at http://www.newlc.com</guid>
</item>
</channel>
</rss>
