Hi
when I draw line using gc.drawline it is drawn behind my container's background image
I want to know how to draw line using (gc.drawline ) in front of any images putted into my container ??
thanks in advance![]()
Hi
when I draw line using gc.drawline it is drawn behind my container's background image
I want to know how to draw line using (gc.drawline ) in front of any images putted into my container ??
thanks in advance![]()
Hello,
how do you draw your background image?
Remember that if you do it in Draw function your gc.drawline must be under lines of your background code.
You could also at the end of your constructL function call DrawNow()
good luck
I've put my background image using drag image item from control menu and edit that image to add an image from project gfx folder , so all code of it is generated code
...
generated code looks something like that:
you can do something like that:Code:iImage1 = new ( ELeave ) CEikImage; { CFbsBitmap *bitmap, *mask; AknIconUtils::CreateIconL( bitmap, mask, KTestAppFile, EMbmTestappList_icon, EMbmTestappList_icon_mask ); AknIconUtils::SetSize( bitmap, TSize( 103, 82 ), EAspectRatioPreserved ); AknIconUtils::SetSize( mask, TSize( 103, 82 ), EAspectRatioPreserved ); iImage1->SetPicture( bitmap, mask ); } iImage1->SetAlignment( EHCenterVBottom );
put in .h file this:
in constructor or somewhere else call:Code:CFbsBitmap *iBitmap, *iMask;//don t forget to delete them in destructor
and in your Draw function:Code:AknIconUtils::CreateIconL( bitmap, mask, KTestAppFile, EMbmTestappList_icon, EMbmTestappList_icon_mask ); AknIconUtils::SetSize( iBitmap, TSize( 103, 82 ), EAspectRatioPreserved ); AknIconUtils::SetSize( iMask, TSize( 103, 82 ), EAspectRatioPreserved );
and it will work you will be able to draw on it without any problemCode:gc.BitBltMasked(TPoint, iBitmap, TRect, iMask, EFalse);
many thanks nuker
the problem is solved ,
really I appreciate it , thank you again![]()
ok now I need to change the position of the image
I changed TPoint in
but it remained in the position that set when it created, it changed only when I moved it in container ..Code:gc.BitBltMasked(TPoint, iBitmap, TRect, iMask, EFalse);
sorry if this question is repeated :$
HI All
I've Succeeded to draw line over bitmap image using nuker code but how to do that using gif image
??
is it impossible to do that using symbian c++? if yes , how ?
thanks in advance
Regards
You can use CMdaImageFileToBitmapUtility to convert gif into Bitmap.
Last edited by Nourayn; 2009-03-31 at 12:32.
Yes, after conversion you can use the already working code to draw it![]()
thanks
can any one Know how ?? :$when I'm drawing the line over the image it seems as transparent so when it becomes over dark part of image it disappeare , so how to use drawline method without line being transparent ??
Are you complaining about that you are drawing a black line on a black image and you can not see it, or what? You may want to experiment with SetDrawMode then.
Hi, it may be so late :$
but I converted the jpg image to bitmap using Image_Reader
using this code :
in constructor :
and calling functionCode:TBuf<50> name1; name1.Append(_L("C:\\Data\\Others\\pics\\n.jpg")); dec = CImage_Reader::NewL( name1,*this);
so it converted to bitmap, and when I'm trying to draw over itCode:void CNorth::ImageReadyL(const TInt& aError , CFbsBitmap* bitmap1) { if(aError == KErrNone) { bitmap = bitmap1; AknIconUtils::SetSize( bitmap, Size(), EAspectRatioPreserved ); iImage1->SetPicture(bitmap ,NULL); iImage1->SetExtentToWholeScreen(); DrawNow(); }
in draw function
but the drawing done behind the image ??Code:gc.BitBlt(TPoint(0,0),bitmap); gc.DrawEllipse(aRect);
can you help me plzzzz ??
Actually you can experiment with aRect if you are interested in what it is, but if you just want to see your eclipse, try using Rect() instead.