×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Regular Contributor
    Join Date
    Feb 2006
    Posts
    141

    issue with overlaping text

    Hi All,

    I've problem with text drawing... when i trying redraw text it always overlaps previous.

    here is a part of my code:

    void CMySlider::Draw( const TRect& aRect ) const
    {
    CWindowGc &gc = SystemGc();

    /*skipped*/

    gc.SetPenColor( KRgbWhite );
    gc.SetPenSize( TSize( 1, 1 ) );
    gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
    gc.SetPenStyle( CGraphicsContext::ESolidPen );

    if ( m_MinFont ) {

    gc.UseFont( m_MinFont );

    if ( m_MinText.Length() > 0 ) {
    gc.DrawText( m_MinText, TPoint(SLIDER_SHRINK, aRect.Height() - m_MaxFont->HeightInPixels()) );
    }

    gc.DiscardFont();
    }

    if ( m_MaxFont ) {

    gc.UseFont( m_MaxFont );

    if ( m_MaxText.Length() > 0 ) {
    gc.DrawText( m_MaxText, TPoint(aRect.Width() - m_MaxFont->TextWidthInPixels(m_MaxText), aRect.Height() - m_MaxFont->HeightInPixels()) );
    }

    gc.DiscardFont();
    }
    }

    DrawNow called from main window by timer event.

    --
    Best Regards

  2. #2
    Nokia Developer Champion
    Join Date
    Jan 2008
    Location
    Moscow, Russia
    Posts
    3,347

    Re: issue with overlaping text

    Doesn't you forget before drawing to clear the area to be drawn to?

  3. #3
    Regular Contributor
    Join Date
    Feb 2006
    Posts
    141

    Re: issue with overlaping text

    Hi A.A.M.,

    Thanks for the reply. Yes, i've tried to do rect cleaning, but then i'd a white screen area... i need to put some text over the video.
    It seems that i misunderstood something ;(


    --
    Best Regards.

    Quote Originally Posted by A.A.M. View Post
    Doesn't you forget before drawing to clear the area to be drawn to?

  4. #4
    Regular Contributor
    Join Date
    Feb 2006
    Posts
    141

    Re: issue with overlaping text

    Hi All,

    How can i redraw the text rectangle only???? because if redrawing full screen window i'd a flickering video.

    --
    Best Regards.

    Quote Originally Posted by shadow-2005 View Post
    Hi A.A.M.,

    Thanks for the reply. Yes, i've tried to do rect cleaning, but then i'd a white screen area... i need to put some text over the video.
    It seems that i misunderstood something ;(


    --
    Best Regards.

  5. #5
    Nokia Developer Champion
    Join Date
    Jan 2008
    Location
    Moscow, Russia
    Posts
    3,347

    Re: issue with overlaping text

    See How to clear a rectangle

    virtual IMPORT_C void Clear(const TRect &aRect);
    Description
    Clears a rectangular area of a window.
    The cleared area is filled with the current brush colour.

    Parameters
    const TRect &aRect The rectangle to clear.

    --
    PS: Also see this thread http://discussion.forum.nokia.com/fo...d.php?p=545434

  6. #6
    Regular Contributor
    Join Date
    Feb 2006
    Posts
    141

    Re: issue with overlaping text

    Hello A.A.M.,

    Thanks a lot for an advise... but it's not a what i'm looking for. In case of redrawing text rectangle only, i've a black screen area on the video. I need to redraw text with some transparent rectangle, but in that case text is not redrew, and i'd an overlapping text again ;)

    Don't know what to do ;(

    How do you think, if i try to use CEikLabel it could help? could i set transparent background for the CEikLabel object? If so, text inside CEikLabel can be redrew properly or not?

    Or maybe i can create some status pane or/and navi pane with transparent background?

    --
    Best Wishes.

    Quote Originally Posted by A.A.M. View Post
    Last edited by shadow-2005; 2009-02-20 at 04:18.

  7. #7
    Nokia Developer Champion
    Join Date
    Jan 2008
    Location
    Moscow, Russia
    Posts
    3,347

    Re: issue with overlaping text

    I could recommend you to check this thread for getting more advanced advices - http://discussion.forum.nokia.com/fo...d.php?t=159301

  8. #8
    Regular Contributor
    Join Date
    Feb 2006
    Posts
    141

    Re: issue with overlaping text

    Hi A.A.M.,

    Thanks... i've another question ;)

    why this code doesn't work properly:

    /* Load bitmaps from files */
    TInt index = 0;
    for ( ; index < PICS_COUNT; index++ ) {

    m_pPics[index] = newl() CFbsBitmap();

    CleanupStack::PushL(m_pPics[index]);
    TRAPD(iLoadImageErr, m_pPics[index]->Load(g_PicsFileNameArray[index]));
    TSize iSize = m_pPics[index]->SizeInPixels();
    User::LeaveIfError(iLoadImageErr);
    CleanupStack::Pop();
    };

    i know that is my mbm files are placed in the correct place... because Load() method didn't return a error... but for some reasons iSize is always has: 0, 0 values...
    and of course then when i'm trying to BitBlt() my pictures, i've nothing on the screen ;)

    MBM were created by using bmconv utility from 24Bit bitmaps with 1x10 pixels size.

    --
    Best Regards.

    Quote Originally Posted by A.A.M. View Post
    I could recommend you to check this thread for getting more advanced advices - http://discussion.forum.nokia.com/fo...d.php?t=159301

Similar Threads

  1. How to append text in a text file in j2me
    By lovely_334801 in forum Mobile Java Networking & Messaging & Security
    Replies: 4
    Last Post: 2010-04-26, 11:10
  2. Issue with recurrent event PIM interface on N95 8Gb
    By gaggou in forum Mobile Java General
    Replies: 0
    Last Post: 2009-02-17, 16:28
  3. MMS message multiple slides issue [SMIL]
    By hrmhrmhrmhrm in forum General Messaging
    Replies: 0
    Last Post: 2007-07-24, 02:13
  4. Text Direction issue with displaying strings
    By iyuen in forum Mobile Java General
    Replies: 4
    Last Post: 2007-04-01, 00:55
  5. global root overflow(please help)
    By sushant_125 in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2004-05-14, 08:24

Posting Permissions

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