Results 1 to 3 of 3

Thread: Shapemode

  1. #1
    Join Date
    Feb 2008
    Posts
    102
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question Shapemode

    The mode QGraphicsPixmapItem::BoundingRectShape has this kind of behaviour:

    "The shape is determined by tracing the outline of the pixmap. This is the fastest shape mode, but it does not take into account any transparent areas on the pixmap."

    How can i have a different behaviour? I'd like to take into account also the transparent areas on a pixmap so when i call the function itemAt(), it will return the item even if I put the mouse cursor on the transparent area.

    perhaps i have to use the setMask() function.....?? How can i use it?
    Last edited by dreamer; 2nd May 2008 at 16:10. Reason: updated contents

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Shapemode

    Your requirement -
    How can i have a different behaviour? I'd like to take into account also the transparent areas on a pixmap
    QGraphicsPixmapItem::BoundingRectShape behaviour:
    "The shape is determined by tracing the outline of the pixmap. This is the fastest shape mode, but it does not take into account any transparent areas on the pixmap."

    arent they similar ?? does not take into account means it includes the transparent pixels too.


    for QGraphicsPixmapItem::MaskShape
    The shape is determined by calling QPixmap::mask(). This shape includes only the opaque pixels of the pixmap. Because the shape is more complex, however, it can be slower than the other modes, and uses more memory.
    In this the transparent pixels are ignored


    Did u try setting the QGraphicsPixmapItem::BoundingRectShape and check how it works ??

  3. The following user says thank you to aamer4yu for this useful post:

    dreamer (2nd May 2008)

  4. #3
    Join Date
    Feb 2008
    Posts
    102
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Shapemode

    i try it and now works........thx a lot..............

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.