×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Sep 2009
    Posts
    285

    Error using : Image Resizing Example

    Hi!

    I'm having a problem when using the Image Resizing Example.
    I am writing a simple console application (no GUI) that will re-size an image.

    To use the class, I performed the following steps -
    1) Added ImageResizer.cpp to my ./src directory (and made the necessary changes in the .mmp file).
    2) Added ImageResizer.h to my ./inc directory

    In the code, I read the image bitmap (3 channel or RGB bitmap) and it is stored using variable iBitmap. iBitmap is of the class - CFbsBitmap.
    As stated in the wiki, I performed the following steps to get a re-sized bitmap:
    Code:
    iImageResizer = new (ELeave) CImageResizer(this);
    iImageResizer->ConstructL(*iBitmap,TSize(50,70));
    CFbsBitmap* pImage = iImageResizer->Bitmap();
    However, when I compile the code, I get the following error -
    undefined identifier 'iImageResizer'
    undefined identifier 'iImageResizer'
    undefined identifier 'iImageResizer'
    Each error points to one line of the three mentioned above.

    I have ensured that all the header files are included and all the libraries have been added to the .mmp file. Yet, I get the above three errors.

    Any idea what I could do?

    Thanks
    Kedar
    Last edited by kedarm; 2010-03-29 at 07:44. Reason: typo

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,684

    Re: Error using : Image Resizing Example

    The compiler is usually right. You have no variable called 'iImageResizer' in the given context.

  3. #3
    Regular Contributor
    Join Date
    Sep 2009
    Posts
    285

    Re: Error using : Image Resizing Example

    Quote Originally Posted by wizard_hu_ View Post
    The compiler is usually right. You have no variable called 'iImageResizer' in the given context.
    Hi!

    I tried the following -
    Code:
    CImageResizer *iImageResizer = new (ELeave) CImageResizer(this);
    iImageResizer->ConstructL(*iBitmap,TSize(50,70));
    CFbsBitmap* pImage = iImageResizer->Bitmap();
    But, this gave me an error - Illegal use of 'this'

    I also tried the following -
    Code:
    CImageResizer *iImageResizer = NULL;
    iImageResizer->ConstructL(*iBitmap,TSize(50,70));
    CFbsBitmap* pImage = iImageResizer->Bitmap();
    But, I guess this does not allocate any memory, and this gave me run-time errors.

    How should I define iImageResizer to use it?

    I saw in the example given at the bottom of the page (HelloImage.zip). In the example, in file HelloImageAppView.cpp, the image-resizer is defined as
    Code:
    void CHelloImageAppView::ConstructL(const TRect& aRect)
    	{
    	// Create a window for this application view
    	CreateWindowL();
    	// Set the windows size
    	SetRect(aRect);
    	iImageConverter = new (ELeave) CImageConverter(this);
    	//gives a path of image that you want to load and resize.
    	iImageConverter->ConstructL(_L("c:\\data\\01.jpg"));
    	iImageResizer = new (ELeave) CImageResizer(this);
    	// Activate the window, which makes it ready to be drawn
    	ActivateL();
    	}
    I am trying to use it in the same way, except instead of using it in the constructor, I am using it as part of my code. Is that the reason why I am getting errors?

    I also tried using the CBitMapScaler class. I added the following code -
    Code:
    	TRequestStatus* bs;
    	iB->LockHeap();
    	CBitmapScaler* iBmpScale;
    	iBmpScale = CBitmapScaler::NewL();
    	iBmpScale->Scale(bs, *iB, TSize(160,120));
    	iB->UnlockHeap();
    However, when I run the above code in the emulator, the emulator seems to hang. It doesn't respond at all. I finally have to close the emulator and restart it.

    Thanks
    Kedar
    Last edited by kedarm; 2010-03-29 at 13:31.

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

    Re: Error using : Image Resizing Example

    You need a real active object, that uninitialized "TRequestStatus *bs" is an extremely bad idea.
    In addition if you use CFbsXy stuff in GUI-less code, you will need an RFbsSession. Just Connect it at the start of your code, and Close at the end.

Similar Threads

  1. Problem with Image show application
    By yatin_indianic in forum Mobile Java General
    Replies: 1
    Last Post: 2010-03-09, 07:13
  2. load image problem
    By Pmarcoen in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2009-08-23, 06:19
  3. Replies: 1
    Last Post: 2008-07-11, 02:32
  4. Is MIDP2.0 over Symbian OS slow?
    By epolitakis in forum Mobile Java Games
    Replies: 7
    Last Post: 2007-03-16, 09:32
  5. Image resizing - Wallpaper
    By ron_dunkley in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2003-10-10, 21:32

Posting Permissions

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