Results 1 to 6 of 6

Thread: Pixmap Overlay

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Ohio
    Posts
    332
    Thanks
    37
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Pixmap Overlay

    Should it matter what the activeX control wants since I have my DirectShow object inside a QAxWidget? I would think the QAxWidget would allow an alomst-transparent QPixmap to be displayed over it. Or does the QAxWidget have no control or say over this? Thanks again but I will take what you said into consideration!

  2. #2
    Join Date
    Jan 2006
    Location
    Ohio
    Posts
    332
    Thanks
    37
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Red face Re: Pixmap Overlay

    After looking through adding an overlay through some DirectShow commands, I discovered DirectShow's functionality to add the overlay was not sufficient enough to handle my needs. Right now, I am trying to just create an overlay to put on top of my buttons to get a handle on how to use transparent overlays. Here is essentially what I want it to do.

    I intialize a couple things like this:
    Qt Code:
    1. QWidget* privateLayoutWidget = new QWidget( this );
    2. privateLayoutWidget->setGeometry( QRect( 182, 429, 248, 40 ) );
    3. mpButtonLayout = new QHBoxLayout( privateLayoutWidget );
    4.  
    5. QSize videoButtonSize( 30, 25 );
    6. mpGoBeginningButton = new QToolButton( privateLayoutWidget );
    7. mpGoBeginningButton->setMinimumSize(videoButtonSize );
    8. QFont webDings_font( "Webdings", 12 );
    9. mpGoBeginningButton->setFont( webDings_font );
    10. mpGoBeginningButton->setText( "9" );
    11. mpGoBeginningButton->setToolTip( "Jump to beginning of video" );
    12. mpButtonLayout->addWidget( mpGoBeginningButton );
    13. ...
    14. mpTest = new QPixmap( 500, 500 );
    15. mpTest->fill( Qt::transparent );
    To copy to clipboard, switch view to plain text mode 

    Then to draw my pixmap onto my object, I do the following:
    Qt Code:
    1. if( event->type( ) == QEvent::Paint )
    2. {
    3. if( pMediaSeeking != NULL )
    4. {
    5. QPainter* painter2;
    6. painter2 = new QPainter( mpTest );
    7. painter2->setPen( QPen( Qt::green, 3 ) );
    8. for( int i = 0 ; i < azElPoints.size( ) ; i++ )
    9. {
    10. if( azElPoints[i].frameNumber == getCurrentFrame( ) )
    11. {
    12. if( erasePoint == true )
    13. {
    14. // Fill the overlay with transparent again since using a
    15. // transparent pen does not remove the red dot.
    16. mpTest->fill( Qt::transparent );
    17. }
    18. painter2->drawPoint( azElPoints[i].xPos, azElPoints[i].yPos );
    19. }
    20. }
    21. //updateAlphaBitmap( );
    22. repaintWindow( );
    23. delete painter2;
    24. QPainter *painter = new QPainter( mpGoBeginningButton );
    25. painter->drawPixmap( 0, 0, *mpTest );
    26. delete painter;
    27. return true;
    28. }
    29. }
    To copy to clipboard, switch view to plain text mode 

    Is this the correct way to try and make a transparent QPixmap because if so, I cannot get it to work. I am thinking maybe I should do something other than a fill( transparent ) to make the transparent QPixmap besides the occasional dot of color, but I do not know what it is that I am missing. Any more guidance with this would be great! Thanks!
    Last edited by ToddAtWSU; 22nd June 2006 at 20:42.

Similar Threads

  1. Invalid pixmap
    By munna in forum Newbie
    Replies: 2
    Last Post: 8th June 2006, 08:00
  2. Paint XP radio button to pixmap
    By Ben.Hines in forum Qt Programming
    Replies: 2
    Last Post: 26th April 2006, 21:15
  3. Changing pixmap in PixmapLabel
    By bullerwj in forum Qt Tools
    Replies: 1
    Last Post: 11th April 2006, 22:28
  4. What's the correct way of clearing a pixmap?
    By karye in forum Qt Programming
    Replies: 4
    Last Post: 19th January 2006, 17:46
  5. How to paint a selection rectangle on a pixmap?
    By SkripT in forum Qt Programming
    Replies: 6
    Last Post: 8th January 2006, 19:52

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.