×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Oct 2010
    Posts
    113

    access Image from file system....

    Dear Sir,

    I have requirement to access image file from C:\\ data\\image in phone. I am able to install images on phone but not able to get image from that path display its on main screen of the device.
    please suggest how its possible to access & display on screen in s60 fp2 sdk.

    thanx in advance!!!

    Regards,
    Satish

  2. #2
    Registered User
    Join Date
    Nov 2010
    Posts
    59

    Re: access Image from file system....

    Basically you've to use CFbsBitmap::Load() to load image from a file and Draw the bitmap in the Draw function of your control

    Check out this thread for details.
    Last edited by singh.parminder02; 2012-02-21 at 08:30.

  3. #3
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: access Image from file system....

    Actually not excatly that easy... if the image is in mbm format, and you are using it in its original size, then you can use CFbsBitmap::Load().

    if it is in mbm (and you want to use it in other size than original) or its mif format file, then you should use AknIconUtils for loading the image, so you can use the AknIconUtils::SetSize () for sizing it.

    And if it is in any other format (which is supported) then you actually need to use image decoder API for loading it to CFbsBitmap..

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,699

    Re: access Image from file system....

    Since Satish used a significant amount of CFbsBitmap in the other thread, I guess the new question is about loading "well-known" formats, JPEG and the like. Check CImageDecoder class in this case. Since it is an asynchronous operation by default you will probably like the trick of using it in a synchronous way: http://www.developer.nokia.com/Commu..._synchronously

  5. #5
    Registered User
    Join Date
    Oct 2010
    Posts
    113

    create custom focus flage ......

    Dear Sir,

    Please suggest how to create custom focus for Cfbsbitmap image. I am able to create bitmap & draw its on screen. but my problem is how to handle some event with bitmap focus. I am not able to handle their focus. please see my below code-
    Code:
    void CMyControlTestContainer::ShowMask()
    	{
    	_LIT(KFileName, "c:\\data\\Images\\14.bmp");
    	CFbsBitmap* iBitmap1 = new (ELeave) CFbsBitmap;
    	iBitmap1 = LoadL(KFileName);
    	delete iBitmap5;
    	iBitmap5 =iBitmap1;
    	//iBitmap =NULL;
    	DrawDeferred();
    	}
    void CMyControlTestContainer::Draw( const TRect& aRect ) const
    	{
    	// [[[ begin generated region: do not modify [Generated Contents]
    	CWindowGc& gc = SystemGc();
    	gc.SetBrushColor(KRgbGray);
    	gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
    	gc.Clear( aRect );
    	if((iBitmap5 != NULL) && (iBitmap5->Handle() != 0))
    		{
    		//gc.DrawRect(aRect);
    		gc.BitBlt(TPoint(180,190), iBitmap5);
    		}
            }
    On page load I have 5 bitmap on screen. & but i have no any control to handle or to set focus of that bmp is true.
    If i am able to find out that this bitmap is focus then handle some event on that.
    please suggest can i set focus of control is true if yes then how?
    thanx in advance!


    Regards,
    Satish

  6. #6
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: create custom focus flage ......

    I think we have discussed this beforehand. Thus plese do not open new thread for old topics that already have been discussed.

    Anyway, lets try this here then now. As the CMyControlTestContainer is your own custom control, simply implement Getter & setter for internal TBool variable, and in the setter simply set the variable, and call DrawNow(), and in Draw() function simply draw the focus if the boolen variable is set to true.

  7. #7
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,699

    Re: create custom focus flage ......

    CFbsBitmap can not load .bmp files, I already pointed to the solution yesterday in your other thread. Post #4, since the threads are merged now.

Similar Threads

  1. File system access on Qt Simulator
    By vaidehik in forum [Archived] Beginning Qt
    Replies: 3
    Last Post: 2011-04-14, 16:31
  2. File System access
    By eugie17 in forum Mobile Java General
    Replies: 5
    Last Post: 2008-11-18, 12:08
  3. Multiple access to file on file system
    By prakash.raman in forum Mobile Java General
    Replies: 2
    Last Post: 2008-05-22, 15:03
  4. Access to the file system
    By alys56 in forum Mobile Java General
    Replies: 2
    Last Post: 2008-03-21, 16:02
  5. file system access
    By yosrime in forum Mobile Java General
    Replies: 3
    Last Post: 2006-10-17, 01:44

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×