Rubberband

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mas Fabien

    Rubberband

    Hi,
    I want to manage a rubberband
    For that, I use the "controlPai nt" class.
    No problem to draw my rectangle, I use "DrawReversible Frame()"
    No problem to draw my selection, I use "DrawSelectionF rame()"
    No problem to draw my hands, I use "DrawGrabHandle ()"
    But after, I don't know how to do to erase my selection and my hands.
    And how can I manage my hands ?

    Fabien :)


  • Derrick Coetzee [MSFT]

    #2
    Re: Rubberband

    "Mas Fabien" <fabien@iom.f r> wrote:[color=blue]
    > No problem to draw my rectangle, I use "DrawReversible Frame()"
    > No problem to draw my selection, I use "DrawSelectionF rame()"
    > No problem to draw my hands, I use "DrawGrabHandle ()"
    > But after, I don't know how to do to erase my selection and my hands.[/color]

    There are a few main ways of doing this:

    1. Redraw the underlying stuff: Redraw everything you drew underneath the
    graphic objects on top of them, then draw your graphic objects in a new
    position if you desire. This is a slow but common method of erasing things,
    and works well if the background is simple.
    2. Buffering: Variation on #1. Redraw everything, including the updated
    selection, but do it in a memory-based device context the user does not see.
    Then blit it quickly all at once into your window. This often gives a
    smoother appearance.
    3. Save the underlying stuff: Keep a memory-based device context in which
    you draw your underlying image, then each time you wish to erase the
    graphics on top, copy it or sections of it on top of them.
    4. Use 3D acceleration: use Direct3D or OpenGL to create an isometric view
    with overlapping polygons that fill the window. Make the top polygon have a
    partly transparent texture with your selection graphics on it. This is a lot
    more efficient than it sounds, and you can see similar samples in the
    DirectX SDK.

    I realise this seems complicated just to "erase" something, but effectively
    you're trying to restore lost information. I hope this helps, and please
    write back if you'd like any additional explanation.
    --
    Derrick Coetzee, Microsoft Speech Server developer
    This posting is provided "AS IS" with no warranties, and confers no rights.


    Comment

    Working...