Sorry for the stupid question, but I'm new in Symbian programming.
My application includes UI, View & Container files. I've added in
UI file treatment of Save command, function SaveL in View file, and draw function in Container file.
Do I try to use right structure???
I included fbs.h in view header and fbscli.lib in mmp.
Also in view header CFbsBitmap* iBitmap,
in View.cpp ConstructL(): iBitmap = new (ELeave) CFbsBitmap();
(I'm going to use CEikonEnv::Static()->ScreenDevice()->CopyScreenToBitmap(iBitmap)
And after adding 2 lines about Bitmap I have a lot of mistakes:
unresolved external symbol public: _thiscall CFbsBitmap::CFbsBitmap(void) ...
cannot open input file appname.exp etc.
What is problem may be here???
And for saving I shoud use something like this:
CMdaImageBitmapToFileUtility* iFileSaver;
iFileSaver->CreateL(KBmpFileName,&iClipFormat,&iCodec,&iCodec); ???
at least the "unresolved external symbol " is caused by the fact that the implementation of the class is not found. So check SDK docs for the needed library, add it to your mmp file and re-build your workspace. Then it should work
I'm sure that implementation of CFbsBitmap() is inside of the fbscli.lib (included in mmp file). I've found according line inside the library file.
My application is very simple, 1 view class: public CAknView, 1 container class: public CCoeControl. And after adding one string iBitmap = new (ELeave) CFbsBitmap();
I've got a lot of mistakes (see below). What can be another reason for it ???????
------ Build started: Project: BASICDRAWING, Configuration: Uni Debug Win32 ------
Building resources from Basicdrawing_caption.rss
perl -S epocrc.pl -I "\SYMBIAN\7.0S\SERIES60_V21\SERIES60EX\BASICDRAWING\GROUP" -I "\SYMBIAN\7.0S\SERIES60_V21\SERIES60EX\BASICDRAWING\GROUP" -I "\SYMBIAN\7.0S\SERIES60_V21\SERIES60EX\BASICDRAWING\INC" -I- -I "\Symbian\7.0s\Series60_v21\EPOC32\INCLUDE" -DLANGUAGE_01 -u "\SYMBIAN\7.0S\SERIES60_V21\SERIES60EX\BASICDRAWING\GROUP\Basicdrawing_caption.rss" -o"\Symbian\7.0s\Series60_v21\EPOC32\RELEASE\WINS\UDEB\Z\SYSTEM\APPS\BASICDRAWING\BASICDRAWING_CAPTION.r01" -h"\SYMBIAN\7.0S\SERIES60_V21\SERIES60EX\BASICDRAWING\GROUP\BASICDRAWING_CAPTION.rs~" -t"\Symbian\7.0s\Series60_v21\EPOC32\BUILD\SYMBIAN\7.0S\SERIES60_V21\SERIES60EX\BASICDRAWING\GROUP\BASICDRAWING\WINS\UDEB"
perl -S ecopyfile.pl "\SYMBIAN\7.0S\SERIES60_V21\SERIES60EX\BASICDRAWING\GROUP\BASICDRAWING_CAPTION.rs~" "\Symbian\7.0s\Series60_v21\EPOC32\INCLUDE\BASICDRAWING_CAPTION.RSG"
del "\SYMBIAN\7.0S\SERIES60_V21\SERIES60EX\BASICDRAWING\GROUP\BASICDRAWING_CAPTION.rs~"
Building resources from Basicdrawing.rss
perl -S epocrc.pl -I "\SYMBIAN\7.0S\SERIES60_V21\SERIES60EX\BASICDRAWING\GROUP" -I "\SYMBIAN\7.0S\SERIES60_V21\SERIES60EX\BASICDRAWING\GROUP" -I "\SYMBIAN\7.0S\SERIES60_V21\SERIES60EX\BASICDRAWING\INC" -I- -I "\Symbian\7.0s\Series60_v21\EPOC32\INCLUDE" -DLANGUAGE_01 -u "\SYMBIAN\7.0S\SERIES60_V21\SERIES60EX\BASICDRAWING\GROUP\Basicdrawing.rss" -o"\Symbian\7.0s\Series60_v21\EPOC32\RELEASE\WINS\UDEB\Z\SYSTEM\APPS\BASICDRAWING\BASICDRAWING.r01" -h"\SYMBIAN\7.0S\SERIES60_V21\SERIES60EX\BASICDRAWING\GROUP\BASICDRAWING.rs~" -t"\Symbian\7.0s\Series60_v21\EPOC32\BUILD\SYMBIAN\7.0S\SERIES60_V21\SERIES60EX\BASICDRAWING\GROUP\BASICDRAWING\WINS\UDEB"
perl -S ecopyfile.pl "\SYMBIAN\7.0S\SERIES60_V21\SERIES60EX\BASICDRAWING\GROUP\BASICDRAWING.rs~" "\Symbian\7.0s\Series60_v21\EPOC32\INCLUDE\BASICDRAWING.RSG"
del "\SYMBIAN\7.0S\SERIES60_V21\SERIES60EX\BASICDRAWING\GROUP\BASICDRAWING.rs~"
Compiling...
Basicdrawing.uid.cpp
BasicDrawingView.cpp
BasicDrawingDocument.cpp
BasicDrawingContainer.cpp
BasicDrawingAppUi.cpp
BasicDrawingApp.cpp
Generating Code...
Performing Pre-Link Event...
Doing first-stage link by name
link.exe @C:\DOCUME~1\JULIAF~1\LOCALS~1\Temp\nm210.tmp
LINK : warning LNK4044: unrecognized option '/WARN:3'; ignored
Creating library \Symbian\7.0s\Series60_v21\EPOC32\BUILD\SYMBIAN\7.0S\SERIES60_V21\SERIES60EX\BASICDRAWING\GROUP\BASICDRAWING\WINS\UDEB\BASICDRAWING.lib and object \Symbian\7.0s\Series60_v21\EPOC32\BUILD\SYMBIAN\7.0S\SERIES60_V21\SERIES60EX\BASICDRAWING\GROUP\BASICDRAWING\WINS\UDEB\BASICDRAWING.exp
BASICDRAWINGCONTAINER.obj : error LNK2019: unresolved external symbol "public: __thiscall CFbsBitmap::CFbsBitmap(void)" (??0CFbsBitmap@@QAE@XZ) referenced in function "private: void __thiscall CBasicDrawingContainer::ConstructL(class TRect const &)" (?ConstructL@CBasicDrawingContainer@@AAEXABVTRect@@@Z)
\Symbian\7.0s\Series60_v21\EPOC32\BUILD\SYMBIAN\7.0S\SERIES60_V21\SERIES60EX\BASICDRAWING\GROUP\BASICDRAWING\WINS\UDEB\BASICDRAWING.APP : fatal error LNK1120: 1 unresolved externals
NMAKE : fatal error U1077: 'link.exe' : return code '0x460'
Stop.
if exist "\Symbian\7.0s\Series60_v21\EPOC32\BUILD\SYMBIAN\7.0S\SERIES60_V21\SERIES60EX\BASICDRAWING\GROUP\BASICDRAWING\WINS\UDEB\BASICDRAWING.exp" del "\Symbian\7.0s\Series60_v21\EPOC32\BUILD\SYMBIAN\7.0S\SERIES60_V21\SERIES60EX\BASICDRAWING\GROUP\BASICDRAWING\WINS\UDEB\BASICDRAWING.exp"
Stopped the build by removing the export object,
if present, because the pre-link stage failed
Linking...
LINK : warning LNK4044: unrecognized option '/WARN:3'; ignored
LINK : fatal error LNK1181: cannot open input file '\Symbian\7.0s\Series60_v21\EPOC32\BUILD\SYMBIAN\7.0S\SERIES60_V21\SERIES60EX\BASICDRAWING\GROUP\BASICDRAWING\WINS\UDEB\BASICDRAWING.exp'
Build log was saved at "file://C:\Symbian\7.0s\Series60_v21\EPOC32\BUILD\SYMBIAN\7.0S\SERIES60_V21\SERIES60EX\BASICDRAWING\GROUP\BASICDRAWING\WINS\UDEB\BuildLog.htm"
BASICDRAWING - 4 error(s), 2 warning(s)
did you remember to re-build (or re-import from mmp file) your project, so all changes done into the mmp file would be then taking afect on your project.
Hello,
Thank you, I didn't know about it.
Now I use:
TInt err = iBitmap->Create(TSize(176,208),EColor64K);
CEikonEnv::Static()->ScreenDevice()->CopyScreenToBitmap(iBitmap);
iBitmap->Save(_L("test.mbm"));
And I've got picture with top pane and menu in the bottom: Select & cancel.
How I can use only middle part of the screen???
I don't think there is a simple solution that you could use to grab just a part of the screen. The obvious solution would be to take the bitmap as you do and then create a smaller one to which you copy only TRect(TPoin(0,44), TSize(176,144)) from the big one.
Hello,
Thank you for responsing.
Also I can use second parameter of CopyScreenToBitmap() TRect to define grabbed part, but how I can set it exactly? It seems to me that different models can have different sizes of screen and I should not use "hard-coding" to set for example (0,44), (176,144)
No, at least not now.
Series60 platform is defined as having screen size 176x208 and you can count on it. (top 44 pixels are for title bar, 144 pixels in the middle are for client area and 20 pixels at the bottom are for command button area)
This will radically change with Feature Pack 3 when new screen sizes will be introduced. FP3 should support scalable UI framework with SVG and these screen resolutions: 176 x 208, 208 x 208, 240 x 320 QVGA, 352 x 416
But it will take some time before the first device with FP3 will be available...