Results 1 to 6 of 6

Thread: how to use bitBlt in QT 3

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2008
    Posts
    12
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default how to use bitBlt in QT 3

    I have try to use bitBlt but it seems failed. the "buffer" is null. Is there any problem with the code?

    Qt Code:
    1. QImage hehe("f_rain1m_e5bff66.jpg" );
    2. QImage buffer;
    3. bitBlt(&buffer, 4, 5 , &hehe, lstBox->x(), lstBox->y(), lstBox->width(), lstBox->height(), CopyROP);
    4. lstBox->setPaletteBackgroundPixmap(buffer);
    5. qWarning("%d",buffer.isNull());
    To copy to clipboard, switch view to plain text mode 

    NB:
    The result in terminal is 1 which mean the buffer is still null, right?

  2. #2
    Join Date
    Aug 2008
    Posts
    9
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: how to use bitBlt in QT 3

    hi, did u got the code working ??
    can u please send me d code pls, i too need it for seeing the blitting thing n it mite save much of my time. i am using Qt 4.4

    thanks in advance,
    Punit.

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to use bitBlt in QT 3

    Quote Originally Posted by garry_3peace View Post
    QImage buffer;
    You create a null image. Give it some size.

  4. #4
    Join Date
    Aug 2008
    Posts
    12
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: how to use bitBlt in QT 3

    Hm... I see, Ok.. I'll try it later...

  5. #5
    Join Date
    Aug 2008
    Posts
    12
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: how to use bitBlt in QT 3

    Hm... still failed..

    I declared it like this:

    QImage buffer(200,200, 1); //right?

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to use bitBlt in QT 3

    Quote Originally Posted by garry_3peace View Post
    QImage buffer(200,200, 1); //right?
    Why "1"? Shouldn't it be 32?

    Quote Originally Posted by garry_3peace View Post
    bitBlt(&buffer, 4, 5 , &hehe, lstBox->x(), lstBox->y(), lstBox->width(), lstBox->height(), CopyROP);
    CopyROP is from the Qt::RasterOp enum, not Qt::ImageConversionFlags. Pass 0 as the last argument, if you don't know what to put there.

    What are the values of x(), y(), width() and height()?

Similar Threads

  1. bitBlt
    By hugo vanwoerkom in forum Qt Programming
    Replies: 3
    Last Post: 16th October 2007, 16:41
  2. why bitBlt() deleted in Qt4
    By iGoo in forum Qt Programming
    Replies: 1
    Last Post: 27th June 2006, 09:59
  3. in porting Qt3 to Qt4, problem with bitBlt
    By impeteperry in forum Qt Programming
    Replies: 15
    Last Post: 24th June 2006, 02:49
  4. Problem with bitBlt
    By yellowmat in forum Newbie
    Replies: 1
    Last Post: 5th April 2006, 14:08

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.