Visual2D Class

class Visual2D: public IVisual, public IBounds2D

Implementation of the IVisual and IBounds2D interfaces. This class contains a RECT structure and implements IBounds2D and ISize2D in terms of that bounding rectangle.

Defined in: Visual.h

See Also

IVisual, IBounds2D, ISize2D

Class Members

Visual2D() : m_rc(0,0,0,0) (0,0,0,0)

Construct a visual 2D object.

CRect m_rc

Bounding rectangle for visual object.

virtual bool QueryGuid(REFGUID guid, void **ppvObj)

Retrieve a pointer to an interface supported by this object.

virtual ULONG STDMETHODCALLTYPE AddRef()

Add a reference to this object.

virtual ULONG STDMETHODCALLTYPE Release()

Release a reference to this object.

virtual CSize GetSize() const

Get the width and height of an object.

virtual CSize SetSize(int cx, int cy)

Set the width and height of an object.

virtual CRect GetBounds() const

Get the bounding rectangle of an object.

virtual CPoint GetOrigin() const

Get the origin of an object.

virtual CPoint SetOrigin(int x, int y)

Set the origin of an object.

virtual CPoint MoveOrigin(int xOff,int yOff)

Move the origin of an object by a given X,Y offset.

virtual void Draw(CDC* pDC)

Draw the object to a device context.

virtual void OnPrepareDC(CDC* pDC)

Prepare device context for rendering.

virtual void OnCleanupDC(CDC* pDC)

Cleanup device context after rendering.

int GetWidth() const

Return the width of the object.

int GetHeight() const

Return the height of the object.