×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Regular Contributor
    Join Date
    Nov 2005
    Location
    Amman/Jordan
    Posts
    322

    CEikRichTextEditor and image

    hello people ?


    can i add an image to CEikRichTextEditor..???

    if yes .. how ?


    thanx

  2. #2
    Regular Contributor
    Join Date
    Mar 2005
    Posts
    60

    Re: CEikRichTextEditor and image

    Nokia's RichText example version 2.0 contains the code to do this. The link is http://sw.nokia.com/id/ce86c31c-4190...le_v2_0_en.zip but if that does not work just search for: RichText editor example

    Basically you create a picture providing class derived from CPicture and insert that into the RichText editor. If your picture is a JPG rather than in an mbm you'll also need to look at CImageDecoder to read it in.

  3. #3
    Regular Contributor
    Join Date
    Nov 2005
    Location
    Amman/Jordan
    Posts
    322

    Re: CEikRichTextEditor and image

    Quote Originally Posted by mike_brock
    Nokia's RichText example version 2.0 contains the code to do this. The link is http://sw.nokia.com/id/ce86c31c-4190...le_v2_0_en.zip but if that does not work just search for: RichText editor example

    Basically you create a picture providing class derived from CPicture and insert that into the RichText editor. If your picture is a JPG rather than in an mbm you'll also need to look at CImageDecoder to read it in.

    thanx alot for youe reply ...
    ok the image is recieved from an http connection ....
    now i know i have to use CImageDecoder to display it .... but still i don't know how to add it to the CEikRichTextEditor ?

    please help

  4. #4
    Regular Contributor
    Join Date
    Mar 2005
    Posts
    60

    Re: CEikRichTextEditor and image

    Download the Rich Text editor example, http://sw.nokia.com/id/ce86c31c-4190...le_v2_0_en.zip.

    You will need to implement a CPicture derived class, which you can base on CMyPicture in that example.

    Then CRTEContainer::InsertMyPictureL has the code for actually inserting a picture into the rich text:

    void CRTEContainer::InsertMyPictureL(TInt aPos)
    {
    CMyPicture* picture;
    // Create a CPicture derived class which will draw our image, depending this Size
    picture = new( ELeave )CMyPicture(TSize(KKImageWidth,KImageHeight),
    *(iBitmap->At(iBitmap->Count()-1)/*process the last item of iBitmap*/));
    CleanupStack::PushL(picture);
    // Prepare the Picture header, which will be instered into the Richtext
    TPictureHeader header;
    header.iPicture =TSwizzle<CPicture>(picture);
    iRtEd->RichText()->InsertL( aPos,header);
    CleanupStack::Pop(); // picture - Richtext take the ownership
    }

    The RichTextEditorContainer files contain all the code to setup and read iBitmap from an MBM.

  5. #5
    Regular Contributor
    Join Date
    Nov 2005
    Location
    Amman/Jordan
    Posts
    322

    Re: CEikRichTextEditor and image

    Quote Originally Posted by mike_brock
    The RichTextEditorContainer files contain all the code to setup and read iBitmap from an MBM.
    i've downloaded the example ... but its a .jpg image ....???

  6. #6
    Regular Contributor
    Join Date
    Mar 2005
    Posts
    60

    Re: CEikRichTextEditor and image

    Use CImageDecoder to convert your JPG into a CFbsBitmap, then pass that CFbsBitmap into your CPicture derived class.

    For details on CImageDecoder search the SDK help file. The openglex example in the 8.0/8.1/9.0 SDK S60Ex contains code that uses CImageDecoder - see Utils.h/cpp.

Posting Permissions

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