hi all,
i am displaying an Image on screen when there is an incoming call. Although i am getting the event of incoming call in my App, But it TAKES TIME TO LOAD IMAGE. Should i use "CDirectScreenAccess" instead.
My code for displaying image, in the Constructor is:
////////////////////////////////////////////////////////////////
RWsSession& wsSession = CEikonEnv::Static()->WsSession();
iWindowGroup = RWindowGroup(wsSession);
iWindowGroup.Construct((TUint32)&iWindowGroup );
iWindowGroup.EnableReceiptOfFocus(EFalse);
iWindowGroup.SetNonFading(ETrue);
CreateWindowL(iWindowGroup);
LoadData(); //Function to load Image
iWindowGroup.SetOrdinalPosition(0, 1);
ActivateL();
///////////////////////////////////////////////////////////////////
And then i am drawing the Image in Draw() function
I don't think that it would help you. The problem probably isn't in the actual bitbld to screen but in loading from the file / converting or whatever else you are doing.
It would help to know what exactly is going on in LoadData() method...
In LoadData Function, i am reading an image(jpeg) from a file, the path of which is already stored in my database, and returning a bitmap using "convert" function of CImageDecoder class. I think this conversion is taking time.
But i have to display the image instantaneously when the phone rings.
hi yucca,
i am trying to save the selected image as mbm, but before that i am scaling it to fit into my Rect. My code hangs at the Scale function of CBitmapScaler.
OK,
but in case i use CActive, then what should i have in RunL() and where should i return my scaled bitmap..
One thing more, when there is an incoming call, before showing the selected image there occurs a white background having size "my Rect" for a while.
And then the image is shown. How to remove that white background.
I am using RWindowGroup. And in Appui i am sending my app in background. then in container constructor i am using SetOrdinalPosition()
basically in your run you would call the function that handleds the bitmap, basically you could define a callback funtion that you cann with the scaled bitmap.
The wait background is propably drawn untill your image is ready.
Basically what I meant with the scaling earlier, was that you should scale the image before saving it, so using Load function for the mbm would be enough in the application. In case you are loading non-scaled image for showing, just don't scale it anymore, use the draw function in gc to draw them into thye desired rect. The scaling basically would only be used to minimize the size of the mbm, and thus making it faster to load.
Also if you simple call load before drawing, you should have valid image before the draw gets called, and the white background should go away.
no I meant that, make the active object scaler as a separate components, that is using a interface definition as a callback to the component that requires the bitmap object. And use the callback interface function to set the bitmap to the component, or at least to indicate it that the scaling is finalized.
Thnx yucca,
i am able to scale the image in my app and save it as mbm file.
But while incoming call, there is still a WHITE BACKGROUND for a while and then my bitmap is loaded.
I am loading the bitmap before ActivateL in the constructor.
hmm, could you them try to modify the draw function on your container. Just make sure you do nothing untill the bitmap pointer is non-NULL as well as the bitmap has a usable handle on it.