×

Discussion Board

Results 1 to 13 of 13
  1. #1
    Regular Contributor
    Join Date
    Feb 2008
    Posts
    208

    Unhappy problem about draw a bitmap

    i am so tired!
    anyone help me solve the bug?

    thanks very much!

    download

  2. #2
    Regular Contributor
    Join Date
    Feb 2008
    Posts
    208

    Re: problem about draw a bitmap

    #ifndef DECODER_H_
    #define DECODER_H_
    #include <e32base.h>
    #include <ImageConversion.h>
    #include <FBS.H>
    #include "drawBltAppView.h"

    class CMyDecoder : public CActive
    {
    public:
    static CMyDecoder* NewL(CdrawBltAppView* aDrawBltAppView);
    CMyDecoder();
    ~CMyDecoder();
    void ConstructL(CdrawBltAppView* aDrawBltAppView);
    void StartDecodeAndDisplay(TFileName& aFileName);

    void RunL();
    void DoCancel();
    private:
    CdrawBltAppView* iDrawBltAppView;
    CImageDecoder* iImageDecoder;
    CFbsBitmap* iBitmap;
    };
    #endif /*DECODER_H_*/


    #include "Decoder.h"

    CMyDecoder* CMyDecoder::NewL(CdrawBltAppView* aDrawBltAppView)
    {
    CMyDecoder* self = new ( ELeave ) CMyDecoder;
    CleanupStack::PushL( self );
    self->ConstructL( aDrawBltAppView );
    CleanupStack::Pop();
    return self;
    }
    CMyDecoder::CMyDecoder():CActive( CActive::EPriorityUserInput )
    {

    }

    CMyDecoder::~CMyDecoder()
    {
    iImageDecoder->Cancel();
    Cancel();
    }

    void CMyDecoder::ConstructL(CdrawBltAppView* aDrawBltAppView)
    {
    iDrawBltAppView = aDrawBltAppView;
    CActiveScheduler::Add( this );
    }
    void CMyDecoder::StartDecodeAndDisplay(TFileName& aFileName)
    {
    RFs iFs; // for opening/saving images from/to files
    User::LeaveIfError( iFs.Connect() );

    iImageDecoder = CImageDecoder::FileNewL( iFs, aFileName );


    iBitmap = new (ELeave) CFbsBitmap();
    iBitmap->Create( iImageDecoder->FrameInfo().iOverallSizeInPixels,
    iImageDecoder->FrameInfo().iFrameDisplayMode );

    // start conversion to bitmap

    iImageDecoder->Convert( &iStatus, *iBitmap );
    SetActive();
    }
    void CMyDecoder::RunL()
    {
    iDrawBltAppView->DrawMyBitmap(iBitmap);
    }
    void CMyDecoder:oCancel()
    {
    iImageDecoder->Cancel();
    }


    what's wrong with my code?

  3. #3
    Regular Contributor
    Join Date
    May 2004
    Posts
    462

    Re: problem about draw a bitmap

    RFs not close.
    Last edited by Skygyl; 2008-03-20 at 05:20.

  4. #4
    Regular Contributor
    Join Date
    Feb 2008
    Posts
    208

    Re: problem about draw a bitmap

    i close ifs ,but the same problem remain

  5. #5
    Regular Contributor
    Join Date
    May 2004
    Posts
    462

    Re: problem about draw a bitmap

    what is your problem, error msg?

  6. #6
    Regular Contributor
    Join Date
    Feb 2008
    Posts
    208

    Re: problem about draw a bitmap

    bmp1:"\\system\\picture\\smilmask.bmp":system error (-12)

    bmp2:"z:\\system\\picture\\smiley.bmp":wserv 9

  7. #7
    Regular Contributor
    Join Date
    Dec 2007
    Location
    India
    Posts
    155

    Re: problem about draw a bitmap

    Hi Where is ur mbm file, i mean location of mbm file.

    Regards
    Md.kashif

  8. #8
    Regular Contributor
    Join Date
    Feb 2008
    Posts
    208

    Re: problem about draw a bitmap

    Quote Originally Posted by mohd kashif View Post
    Hi Where is ur mbm file, i mean location of mbm file.

    Regards
    Md.kashif
    i do not use mbm file, i read the file directly and just put bmp files in that directory.
    _LIT(KMBMFILE, "\\system\\picture\\smiley.bmp");
    TFileName file(KMBMFILE);
    iMyDecoder->StartDecodeAndDisplay(file);

  9. #9
    Regular Contributor
    Join Date
    Dec 2007
    Location
    India
    Posts
    155

    Re: problem about draw a bitmap

    Quote Originally Posted by ptclin_2007 View Post
    bmp1:"\\system\\picture\\smilmask.bmp":system error (-12)

    bmp2:"z:\\system\\picture\\smiley.bmp":wserv 9
    Hi System error -12 means KErrPathNotFound (Unable to find the specified folder ) .

    Regards
    Md.kashif

  10. #10
    Regular Contributor
    Join Date
    Feb 2008
    Posts
    208

    Re: problem about draw a bitmap

    Quote Originally Posted by mohd kashif View Post
    Hi System error -12 means KErrPathNotFound (Unable to find the specified folder ) .

    Regards
    Md.kashif
    what about wserv 9?

    tired!

  11. #11
    Regular Contributor
    Join Date
    May 2004
    Posts
    462

    Re: problem about draw a bitmap

    WSERV 9

    Attempted to use a non-active graphics context.

    A drawing request was sent to a graphics context when the context was not active.

    On the server side, this panic is raised by CWsGc::CommandL() on all requests received when the context isn’t active except EWsGcOpActivate, EWsGcOpDeactivate, EWsGcOpFree, and EWsGcOpTestInvariant.

  12. #12
    Regular Contributor
    Join Date
    May 2004
    Posts
    462

    Re: problem about draw a bitmap

    Quote Originally Posted by ptclin_2007 View Post
    i do not use mbm file, i read the file directly and just put bmp files in that directory.
    _LIT(KMBMFILE, "\\system\\picture\\smiley.bmp");
    TFileName file(KMBMFILE);
    iMyDecoder->StartDecodeAndDisplay(file);
    Your path is not completed, no driver letter.

  13. #13
    Regular Contributor
    Join Date
    Feb 2008
    Posts
    208

    Re: problem about draw a bitmap

    thanks! it can display the picture

    iDrawBltAppView->DrawMyBitmap(iBitmap);
    the DrawMyBitmap(...) function is error

Similar Threads

  1. problem when importing from carbide c++ to vs 2003!
    By misfit.physics in forum Symbian Tools & SDKs
    Replies: 12
    Last Post: 2008-02-19, 09:45
  2. Bitmap image problem
    By phoneynk in forum Symbian
    Replies: 1
    Last Post: 2007-02-27, 16:38
  3. Problem to load a bitmap (the problem continue)
    By marlon.luz in forum Symbian
    Replies: 3
    Last Post: 2007-01-24, 02:58
  4. bitmap drawing problem in exe
    By vladi_rang in forum Symbian
    Replies: 0
    Last Post: 2004-02-19, 08:33

Posting Permissions

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