Compartilhar via


DVASPECT2 (Windows CE 5.0)

Send Feedback

This enumeration contains values used in IViewObject::Draw to specify new drawing aspects used to optimize the drawing process.

typedef enum tagDVASPECT2 {   DVASPECT_OPAQUE = 16,   DVASPECT_TRANSPARENT = 32 } DVASPECT2;

Elements

  • DVASPECT_OPAQUE
    Represents the opaque, easy-to-clip parts of an object. Objects may or may not support this aspect.
  • DVASPECT_TRANSPARENT
    Represents the transparent or irregular parts of on object, typically parts that are expensive or impossible to clip out. Objects may or may not support this aspect.

Remarks

To support drawing optimizations to reduce flicker, an object needs to be able to draw and return the following information about three separate aspects of itself:

  • DVASPECT_CONTENT
    Same as before. Specifies the entire content of an object. All objects should support this aspect.
  • DVASPECT_OPAQUE
    Represents the opaque, easy-to-clip parts of an object. Objects may or may not support this aspect.
  • DVASPECT_TRANSPARENT
    Represents the transparent or irregular parts of on object, typically parts that are expensive or impossible to clip out. Objects may or may not support this aspect.

The container can determine which of these drawing aspects an object supports by calling the new method IViewObjectEx::GetViewStatus. Individual bits return information about which aspects are supported.

If an object does not support the IViewObjectEx interface, it is assumed to support only DVASPECT_CONTENT.

Depending on which aspects are supported, the container can ask the object to draw itself during the front-to-back pass only, the back-to-front pass only, or both. The following cases are possible:

  • Objects supporting only DVASPECT_CONTENT should be drawn during the back-to-front pass, with all opaque parts of any overlapping object clipped out.

    Because all objects should support this aspect, a container not concerned about flickering — maybe because it is drawing in an off-screen bitmap — can opt to draw all objects that way and skip the front-to-back pass.

  • Objects supporting DVASPECT_OPAQUE may be asked to draw this aspect during the front-to-back pass. The container is responsible for clipping out the object's opaque regions returned by IViewObjectEx::GetRegion before painting any further object behind it.

  • Objects supporting DVASPECT_TRANSPARENT may be asked to draw this aspect during the back-to-front pass. The container is responsible for clipping out opaque parts of overlapping objects before letting an object draw this aspect.

Even when DVASPECT_OPAQUE and DVASPECT_TRANSPARENT are supported, the container is free to use these aspects or not. In particular, if it is painting in an off-screen bitmap and consequently is unconcerned about flicker, the container can use DVASPECT_CONTENT and a one-pass drawing only.

However, in a two-pass drawing, if the container uses DVASPECT_OPAQUE during the front-to-back pass, it must use DVASPECT_TRANSPARENT during the back-to-front pass to complete the rendering of the object.

Requirements

OS Versions: Windows CE 3.0 and later.
Header: Ocidl.h.

See Also

IViewObjectEx | IViewObject::Draw | IViewObjectEx::GetViewStatus

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.