Microsoft DirectX 8.1 (C++) |
The CDrawImage class is a worker class for the owning CBaseWindow object. It handles the actual drawing operation from that class. To use this class, be sure to call CDrawImage::NotifyAllocator when the allocator has been agreed upon, and call CDrawImage::NotifyMediaType with a pointer to a CMediaType object (which must not be stack-based, because a pointer is maintained by this class rather than making a copy) when that is agreed.
When the palette changes, call CDrawImage::IncrementPaletteVersion, and before rendering call CDrawImage::SetDrawContext so that the class can obtain the handle to a device context (HDC) handles from the owning CBaseWindow object.
Protected Data Members
m_bStretch | Flag to stretch the images. |
m_bUsingImageAllocator | Flag to determine if samples share DIBSECTION structures. |
m_EndSample | End time for the current sample. |
m_hdc | Main window device context (DC). |
m_MemoryDC | Off-screen draw DC. |
m_pBaseWindow | Owning video window object. |
m_PaletteVersion | Current palette version token. |
m_perfidRenderNow | Moment when returned from draw (for performance logging). |
m_perfidRenderTime | Time taken to render an image (for performance logging). |
m_pMediaType | Pointer to the current media type format. |
m_SourceRect | Source image rectangle. |
m_StartSample | Start time for the current sample. |
m_TargetRect | Destination rectangle. |
Member Functions
CDrawImage | Constructs a CDrawImage object. |
DisplaySampleTimes | Displays a |
DrawImage | Looks after drawing an image to a window. |
FastRender | Draws an image using BitBlt and StretchBlt. |
GetPaletteVersion | Retrieves the currently installed palette version. |
GetSourceRect | Retrieves the current source rectangle. |
GetTargetRect | Retrieves the current target rectangle. |
IncrementPaletteVersion | Increments the current palette version. |
NotifyAllocator | Notifies the draw object which allocator is being used. |
NotifyEndDraw | Indicates the conclusion of image rendering. |
NotifyMediaType | Passes the media type established during connection. |
NotifyStartDraw | Indicates the beginning of image rendering. |
ResetPaletteVersion | Resets the current palette version. |
ScaleSourceRect | Retrieves a scaled version of a provided source rectangle. |
SetDrawContext | Sets the window and off-screen device contexts to draw with. |
SetSourceRect | Sets the source rectangle for the video. |
SetStretchMode | Determines whether it is necessary to stretch. |
SetTargetRect | Sets the target rectangle for the window. |
SlowRender | Uses the Microsoft® Win32® SetDIBitsToDevice and StretchDIBits functions to draw an image. |
UpdateColourTable | Updates the palette held in a DIBSECTION structure. |
UsingImageAllocator | Retrieves the type of samples to be drawn. |