<?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 - stuck with taking images in camera can someone help? - Comments</title>
 <link>http://www.newlc.com/forum/stuck-taking-images-camera-can-someone-help</link>
 <description>Comments for &quot;stuck with taking images in camera can someone help?&quot;</description>
 <language>en</language>
<item>
 <title>Re: stuck with taking images in camera can someone help?</title>
 <link>http://www.newlc.com/forum/stuck-taking-images-camera-can-someone-help#comment-43100</link>
 <description>&lt;p&gt;Thanks prajwal for spending your precious time.&lt;/p&gt;</description>
 <pubDate>Sun, 25 Nov 2007 10:48:18 +0100</pubDate>
 <dc:creator>sandeepmhptr</dc:creator>
 <guid isPermaLink="false">comment 43100 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: stuck with taking images in camera can someone help?</title>
 <link>http://www.newlc.com/forum/stuck-taking-images-camera-can-someone-help#comment-42248</link>
 <description>&lt;p&gt;HI,&lt;/p&gt;

&lt;p&gt;Regarding ur confusions&lt;/p&gt;

&lt;p&gt;2) StartViewFinderBitmapsL:- should be used when u want to get the Bitmap data and u r going to render the bitmaps onto the screen.(UI should be handled by u)&lt;br /&gt;
   StartViewFinderDirectL :- This takes ur window screen and window session as argument and the bitmaps are rendered directly to the given screen(see documentation for more      info)&lt;br /&gt;
3)  As i said after poweroncomplete u can start viewfinder or take picture directly u r right regarding this point.&lt;br /&gt;
4)  You r right here too, for formats see these enumerations CCamera::TFormat &lt;br /&gt;
5) For saving part of the image i can give u a rough code but just read the class CImageEncoder &lt;/p&gt;

&lt;p&gt;        /&lt;span style=&quot;font-weight:bold&quot;&gt;/ Look into the  CImageEncoder::FileNewL there are many versions u can try the one which u feel easy to use&lt;br /&gt;
       // This api opens the file with the specified file name and in the specified format of the image&lt;br /&gt;
        CImageEncoder* encoder = CImageEncoder::FileNewL( iFsSession, iNewFileName, CImageEncoder::EOptionNone, iImageType );   &lt;br /&gt;
       // This api converts the image to the specified format (in the above api) and returns the status in the iStatus variable  &lt;br /&gt;
        encoder-&gt;Convert( &amp;iStatus, *iBitmapSave );&lt;br /&gt;
       &lt;/span&gt;&lt;br /&gt;
I f u ve doubt about iStatus u need to study active objects first.&lt;br /&gt;
6)Regarding streaming to a socket u can use CImageEncoder itself to encode the data. For this u can use DataNewL()&lt;br /&gt;
api instead of FileNewL read the documentation for more info &lt;br /&gt;
&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 hope this clears all u confusion. &lt;/p&gt;</description>
 <pubDate>Fri, 12 Oct 2007 06:26:08 +0200</pubDate>
 <dc:creator>prajwal.r.m</dc:creator>
 <guid isPermaLink="false">comment 42248 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: stuck with taking images in camera can someone help?</title>
 <link>http://www.newlc.com/forum/stuck-taking-images-camera-can-someone-help#comment-42024</link>
 <description>&lt;p&gt;&lt;div class=&quot;bb-quote&quot;&gt;&lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;br /&gt;
It may take time......&lt;br /&gt;
trying hard....&lt;br /&gt;
&lt;/blockquote&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;Thats to be expected in programming.&lt;br /&gt;
Specially when using symbian I have noticed... &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;1) and 2)&lt;br /&gt;
&quot;viewfinder&quot; is, in general, the name for what you look at to aim your camera, also in an old analog camera.&lt;br /&gt;
In digital fotography it is typically lower resolution then the real image. (to be able to handle quicker)&lt;br /&gt;
When you use ViewFinderDirect, the camera api will use direct screen access to put the bitmap on the screen for you, when using ViewFinderBitmaps, you will get the viewfinder as a stream of bitmaps that you can do whatever you want with.&lt;br /&gt;
So the answer is most probably c)&lt;/p&gt;

&lt;p&gt;3)&lt;br /&gt;
No idea.&lt;/p&gt;

&lt;p&gt;4) &lt;br /&gt;
CFbsBitmaps are not compressed, therefore, they are not suitable when taking very high resolution images, because they would need too much memory bandwith to transfer from the camera hardware to your app.&lt;br /&gt;
Therefore, you can only get the highest resolution when choosing the &quot;exif&quot; format, which will tell the camera to output a jpg compressed image.&lt;br /&gt;
Since jpg compression is not compatible with CFbsBitmaps, you will then get the data as a HBufC8*.&lt;br /&gt;
So.. as long as the requested format is compatible with CFbsBitmaps, you will get those, otherwise HBufC8&lt;/p&gt;

&lt;p&gt;5) &lt;br /&gt;
However you want...  what they mean is that the data pointed to will be overwritten on the next image capture, so if you need the image later, you have to copy the data in some way. How depends on what you want to do with it.&lt;/p&gt;

&lt;p&gt;6)&lt;br /&gt;
Depends... some compression is probably a good idea, since it will reduce bandwith and make your app quicker. Though it also has to be weighted agains the time it take to compress.&lt;br /&gt;
Exif data is already compressed jpeg data so doesn&#039;t need more compression.&lt;br /&gt;
Probably this is the quickest if you want to stream, since the camera hardware does the compression for you.&lt;br /&gt;
Decode is what you use when you want to convert from a compressed format to a CFbsBitmap, and Encode is the other way around.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
 <pubDate>Thu, 04 Oct 2007 11:53:21 +0200</pubDate>
 <dc:creator>alh</dc:creator>
 <guid isPermaLink="false">comment 42024 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: stuck with taking images in camera can someone help?</title>
 <link>http://www.newlc.com/forum/stuck-taking-images-camera-can-someone-help#comment-42021</link>
 <description>&lt;p&gt;thanx,&lt;br /&gt;
         Your reply has made me somewhat clear.......&lt;/p&gt;

&lt;p&gt;1&gt;&gt;&gt;&gt;My main confusion was regarding viewfinder...why viewfinder?is it only to show images on the mobile screen&lt;/p&gt;

&lt;p&gt;I think I have got the answer from ur lines&lt;/p&gt;

&lt;p&gt;                        Now there are two thing that u can do &lt;br /&gt;
                                    1) Start the view finder and then take the image&lt;br /&gt;
                                    2) Take the picture directly&lt;/p&gt;

&lt;p&gt;It is only to display images on mobile screen......&lt;/p&gt;

&lt;p&gt;2&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;Something that is not yet clear-&gt;&lt;br /&gt;
                                   There are 2 types of viewfinders-------StartViewFinderBitmapsL  and StartViewFinderDirectL&lt;/p&gt;

&lt;p&gt;                    using StartViewFinderBitmapsL ,The Observer method that gets called is  ViewFinderFrameReady&lt;/p&gt;

&lt;p&gt;                     which Observer Method is called using  StartViewFinderDirectL??????&lt;/p&gt;

&lt;p&gt;                             options:-&lt;br /&gt;
                                      a.same ViewFinderFrameReady&lt;br /&gt;
                                      b. Any other observer method&lt;br /&gt;
                                      c.No Observer method is called...&lt;/p&gt;

&lt;p&gt;3&gt;&gt;&gt;&gt;was suspicious about the &quot;position of  PrepareImageCaptureL()&quot;, Now I think I can place it anywhere before CaptureImage() and after PowerOnComplete().&lt;br /&gt;
But I am still not sure.Require confirmation....&lt;/p&gt;

&lt;p&gt;4&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;In the method ImageReady( CFbsBitmap* aBitmap,HBufC8* , TInt aError ),when is the Image stored  in CFbsBitmap* and when in HBufC*?????????Need explanation.It depends on the formats specified in call to PrepareImage()..&lt;br /&gt;
Which format is required for HBufC*&lt;/p&gt;

&lt;p&gt;and&lt;/p&gt;

&lt;p&gt;which for CFbsBitmap* ?????&lt;/p&gt;

&lt;p&gt;5&gt;&gt;&gt;&gt;&gt;&gt;.In the SDK documentation, I read that &quot;you should not forget to save the captured Image&quot;&lt;/p&gt;

&lt;p&gt;     This means that the image that is obtained(in CFbsBitmap*  or in HBufC8* ) needs to be saved somewhere.But how??????&lt;/p&gt;

&lt;p&gt;6&gt;&gt;Before Streaming on socket Do I need to convert the image ??&lt;br /&gt;
As you wrote that I have to use image conversion Library, now I am sure that I have to do the conversion......&lt;/p&gt;

&lt;p&gt;Then should I use &quot;CImageDecoder&quot;  or &quot;CImage Encoder&quot;....I feel I have to use &quot;CImageDecoder&quot;.But not sure.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
 <pubDate>Thu, 04 Oct 2007 10:55:49 +0200</pubDate>
 <dc:creator>sandeepmhptr</dc:creator>
 <guid isPermaLink="false">comment 42021 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: stuck with taking images in camera can someone help?</title>
 <link>http://www.newlc.com/forum/stuck-taking-images-camera-can-someone-help#comment-42011</link>
 <description>&lt;p&gt;I dont know what is ur exact problem but i can give u a general idea about how to work with camera api&#039;s&lt;/p&gt;

&lt;p&gt;first u should reserve the camera hardware which can be done by calling the api&lt;/p&gt;

&lt;p&gt;CCamera::Reserve ()&lt;/p&gt;

&lt;p&gt;it is a async request so once it completes it ll call the observer method(u need to implement MCameraObserver interface)ReserveComplete with the error code &lt;br /&gt;
if there is no error &lt;br /&gt;
call poweron&lt;/p&gt;

&lt;p&gt;void CCameracallback:: ReserveComplete(TInt aError)&lt;br /&gt;
    {&lt;/p&gt;

&lt;p&gt;    if( KErrNone == aError )&lt;br /&gt;
        {&lt;br /&gt;
        // As there are no erros, its safe to power on the Camera Device.&lt;br /&gt;
        iCamera-&gt;PowerOn();&lt;br /&gt;
        }&lt;br /&gt;
    else&lt;br /&gt;
        {&lt;br /&gt;
        // Oops... Some thing wrong happened and it could not reserve the camera.&lt;br /&gt;
        // So release the camera and report the error.&lt;br /&gt;
        iCamera-&gt;Release();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
once the power on is complete  it ll call the observer method(u need to implement MCameraObserver interface)PowerOnComplete with the error code &lt;br /&gt;
if there is no error &lt;/p&gt;

&lt;p&gt;Now there are two thing that u can do &lt;br /&gt;
1) Start the view finder and then take the image&lt;br /&gt;
2) Take the picture directly&lt;/p&gt;

&lt;p&gt;First one can be done by calling the camera startviewfinder api in PowerOnComplete method in the following way&lt;br /&gt;
 void CCameraCallback:: PowerOnComplete(TInt aError)&lt;br /&gt;
    {&lt;br /&gt;
    if( KErrNone == aError )&lt;br /&gt;
        {&lt;br /&gt;
        // Everything is going fine. Now we can start the ViewFinder operation.&lt;br /&gt;
       TSize size(200,200);       &lt;br /&gt;
        //Request largest image&lt;br /&gt;
        iCamera-&gt;PrepareImageCaptureL(CCamera::EFormatFbsBitmapColor16M, 0 );&lt;br /&gt;
        // Start the view finding, and transfer the view finder data.&lt;br /&gt;
        // Bitmaps are returned by MCameraObserver::ViewFinderFrameReady().&lt;br /&gt;
        iCamera-&gt;StartViewFinderBitmapsL(size); &lt;br /&gt;
        }&lt;br /&gt;
    }&lt;/p&gt;

&lt;p&gt;Now the camera class ll call the Observer method with the bitmap now call the takepicture method after stoping the view finder&lt;/p&gt;

&lt;p&gt;void CCameraCallback::ViewFinderFrameReady( CFbsBitmap&amp; aFrame)&lt;br /&gt;
   {&lt;br /&gt;
   iCamera-&gt;StopViewFinder();&lt;br /&gt;
  iCamera-&gt;CaptureImage();&lt;br /&gt;
   }&lt;/p&gt;

&lt;p&gt;Now the camera class ll call the Observer method ImageReady()&lt;/p&gt;

&lt;p&gt;void CCameraServiceProvider::ImageReady( CFbsBitmap* aBitmap,HBufC8* , TInt aError )&lt;br /&gt;
    {&lt;br /&gt;
    //Now u ve got the captured Bitmap aBitmap &lt;br /&gt;
   // u need to use the image converting library to save it in any of the supported formats&lt;br /&gt;
  //see CImageEncoder class for more info&lt;br /&gt;
    }&lt;/p&gt;

&lt;p&gt;2) for direct caputre after PowerOnComplete&lt;/p&gt;

&lt;p&gt;void CCameraCallback:: PowerOnComplete(TInt aError)&lt;br /&gt;
    {&lt;br /&gt;
    if( KErrNone == aError )&lt;br /&gt;
        {       &lt;br /&gt;
        //Request largest image&lt;br /&gt;
        iCamera-&gt;PrepareImageCaptureL(CCamera::EFormatFbsBitmapColor16M, 0 );&lt;br /&gt;
        iCamera-&gt;CaptureImage();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
this ll call the same CCameraServiceProvider::ImageReady( CFbsBitmap* aBitmap,HBufC8* , TInt aError ) method with the captured bitmap and u can use imageconversion library&lt;/p&gt;

&lt;p&gt;I hope this is clear &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>Thu, 04 Oct 2007 08:05:00 +0200</pubDate>
 <dc:creator>prajwal.r.m</dc:creator>
 <guid isPermaLink="false">comment 42011 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: stuck with taking images in camera can someone help?</title>
 <link>http://www.newlc.com/forum/stuck-taking-images-camera-can-someone-help#comment-42010</link>
 <description>&lt;p&gt;yes I am confused but &lt;br /&gt;
find it difficult to explain what my confusion is.........&lt;br /&gt;
It may take time......&lt;br /&gt;
trying hard....&lt;/p&gt;

&lt;p&gt;Thanx Mr.Allh &lt;br /&gt;
for ur precious advice...&lt;/p&gt;</description>
 <pubDate>Thu, 04 Oct 2007 07:50:20 +0200</pubDate>
 <dc:creator>sandeepmhptr</dc:creator>
 <guid isPermaLink="false">comment 42010 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: stuck with taking images in camera can someone help?</title>
 <link>http://www.newlc.com/forum/stuck-taking-images-camera-can-someone-help#comment-42009</link>
 <description>&lt;p&gt;I think you need to be a bit more specific in what your problem is, for anyone to be able to help you.&lt;/p&gt;

&lt;p&gt;I have never used the camera api, and don&#039;t have time to read up on it just to proof read every line of your code to know if you &quot;do it right&quot; so far...&lt;/p&gt;

&lt;p&gt;But if you had any more information on where you get stuck, what doesn&#039;t work as you intend, or what exactly it is that confuse you, maybe I or someone else with good general symbian knowledge could give you more pointers to what to do.&lt;/p&gt;

&lt;p&gt;As the question is asked now, I think most people just click away. Most people don&#039;t have time to read long source dumps just to understand what you are asking about...&lt;br /&gt;
&lt;/p&gt;</description>
 <pubDate>Wed, 03 Oct 2007 14:41:54 +0200</pubDate>
 <dc:creator>alh</dc:creator>
 <guid isPermaLink="false">comment 42009 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: stuck with taking images in camera can someone help?</title>
 <link>http://www.newlc.com/forum/stuck-taking-images-camera-can-someone-help#comment-41954</link>
 <description>&lt;p&gt;am i doing it right way????????&lt;/p&gt;</description>
 <pubDate>Mon, 01 Oct 2007 14:09:10 +0200</pubDate>
 <dc:creator>sandeepmhptr</dc:creator>
 <guid isPermaLink="false">comment 41954 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: stuck with taking images in camera can someone help?</title>
 <link>http://www.newlc.com/forum/stuck-taking-images-camera-can-someone-help#comment-41953</link>
 <description>&lt;p&gt;What to do next?????????&lt;/p&gt;</description>
 <pubDate>Mon, 01 Oct 2007 14:05:18 +0200</pubDate>
 <dc:creator>sandeepmhptr</dc:creator>
 <guid isPermaLink="false">comment 41953 at http://www.newlc.com</guid>
</item>
<item>
 <title>stuck with taking images in camera can someone help?</title>
 <link>http://www.newlc.com/forum/stuck-taking-images-camera-can-someone-help</link>
 <description>&lt;p&gt;Hi,&lt;br /&gt;
    I am currently writing code to capture images in camera and stream them through sockets..&lt;/p&gt;

&lt;p&gt;Now I am stuck after the CCamer::PowerOnComplete().Dont know what to do next&lt;/p&gt;

&lt;p&gt;Here is the code&lt;/p&gt;

&lt;p&gt;void CXXXX::PowerOnComplete(TInt aError)&lt;br /&gt;
	{&lt;br /&gt;
	if(aError == KErrNone)&lt;br /&gt;
		{&lt;br /&gt;
		TCameraInfo info;&lt;br /&gt;
		iCamera-&gt;CameraInfo(info);&lt;br /&gt;
		if(info.iOptionsSupported &amp; info.EViewFinderDirectSupported  )&lt;br /&gt;
&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.newlc.com/forum/stuck-taking-images-camera-can-someone-help&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.newlc.com/forum/stuck-taking-images-camera-can-someone-help#comments</comments>
 <category domain="http://www.newlc.com/forums/camera">Camera</category>
 <pubDate>Mon, 01 Oct 2007 14:00:16 +0200</pubDate>
 <dc:creator>sandeepmhptr</dc:creator>
 <guid isPermaLink="false">19145 at http://www.newlc.com</guid>
</item>
</channel>
</rss>
