Home   Index   About
Ultimate Pack


Custom Search
Overview
Group
Quick Info

DrawDibDraw

The DrawDibDraw function draws a DIB to the screen.

BOOL DrawDibDraw(

HDRAWDIB hdd,

HDC hdc,

int xDst,

int yDst,

int dxDst,

int dyDst,

LPBITMAPINFOHEADER lpbi,

LPVOID lpBits,

int xSrc,

int ySrc,

int dxSrc,

int dySrc,

UINT wFlags

);

Parameters

hdd

Handle of a DrawDib DC.

hdc

Handle of the DC.

xDst and yDst

The x- and y-coordinates, in MM_TEXT client coordinates, of the upper left corner of the destination rectangle.

dxDst and dyDst

Width and height, in MM_TEXT client coordinates, of the destination rectangle. If dxDst is pics/MMEDIA00090000.gif 1, the width of the bitmap is used. If dyDst is pics/MMEDIA00090000.gif 1, the height of the bitmap is used.

lpbi

Address of the BITMAPINFOHEADER structure containing the image format. The color table for the DIB within BITMAPINFOHEADER follows the format and the biHeight member must be a positive value; DrawDibDraw will not draw inverted DIBs.

lpBits

Address of the buffer that contains the bitmap bits.

xSrc and ySrc

The x- and y-coordinates, in pixels, of the upper left corner of the source rectangle. The coordinates (0,0) represent the upper left corner of the bitmap.

dxSrc and dySrc

Width and height, in pixels, of the source rectangle.

wFlags

Applicable flags for drawing. The following values are defined:

DDF_BACKGROUNDPAL

Realizes the palette used for drawing in the background, leaving the actual palette used for display unchanged. This value is valid only if DDF_SAME_HDC is not set.

DDF_DONTDRAW

Current image is decompressed but not drawn. This flag supercedes the DDF_PREROLL flag.

DDF_FULLSCREEN

Not supported.

DDF_HALFTONE

Always dithers the DIB to a standard palette regardless of the palette of the DIB. If your application uses the DrawDibBegin function, set this value in DrawDibBegin rather than in DrawDibDraw.

DDF_HURRYUP

Data does not have to be drawn (that is, it can be dropped) and DDF_UPDATE will not be used to recall this information. DrawDib checks this value only if it is required to build the next frame; otherwise, the value is ignored.

This value is usually used to synchronize video and audio. When synchronizing data, applications should send the image with this value in case the driver needs to buffer the frame to decompress subsequent frames.

DDF_NOTKEYFRAME

DIB data is not a key frame.

DDF_SAME_HDC

Use the current DC handle and the palette currently associated with the DC.

DDF_SAME_DRAW

Use the current drawing parameters for DrawDibDraw. Use this value only if lpbi, dxDst, dyDst, dxSrc, and dySrc have not changed since using DrawDibDraw or DrawDibBegin. DrawDibDraw typically checks the parameters, and if they have changed, DrawDibBegin prepares the DrawDib DC for drawing. This flag supercedes the DDF_SAME_DIB and DDF_SAME_SIZE flags.

DDF_UPDATE

Last buffered bitmap is to be redrawn. If drawing fails with this value, a buffered image is not available and a new image needs to be specified before the display can be updated.

Return Values

Returns TRUE if successful or FALSE otherwise.

Remarks

DDF_DONTDRAW causes DrawDibDraw to decompress but not display an image. A subsequent call to DrawDibDraw specifying DDF_UPDATE displays the image.

If the DrawDib DC does not have an off-screen buffer specified, specifying DDF_DONTDRAW causes the frame to be drawn to the screen immediately. Subsequent calls to DrawDibDraw specifying DDF_UPDATE fail.

Although they are set at different times, DDF_UPDATE and DDF_DONTDRAW can be used together to create composite images off-screen. When the off-screen image is complete, you can display the image by calling DrawDibDraw.

See Also

BITMAPINFOHEADER
, DrawDibBegin


Last news from Greatis Software

Nostalgia .Net     Nostalgia .Net     .Net is powerful, but not all-powerful, so sometimes we need to use Win32 API for our .Net applications. It's simple enough with Platform Invoke if you have Win32 skill, but we do not always have time to dig the ancient documentation, declare the special types that are compatible with Win32, find the values of the Win32's constants and so on. Nostalgia .Net offers several simple-to-use classes, and components that will allow you to forget about the headache of Win32 and just use the power of Win32 in your application the same way as you use the native. Net classes.  More »

Recommended software for developers

Ultimate Pack for Delphi and C++ Builder     Ultimate Pack     Component pack for Delphi and C++ Builder that contains runtime form designer, runtime object inspector, print suite and much more for the very special price.  More »

Form Designer .Net     Form Designer .Net     Unique runtime form design solution that allows to edit any form in .Net WinForms application at runtime with full source codes for only 300 euro!  More »

Print Suite .Net     Print Suite .Net     Print Suite .Net is a set of components for easy printing texts, images and grids from your WinForms applications. Full C# source codes are available  More »

Gradient Controls .Net     Gradient Controls .Net     Gradient Controls .Net offers controls with gradient background feature. Labels, panels and so on... Full C# source codes are available  More »

iGrid     Greatis iGrid     iGrid plots drawing grid right over your desktop, so you can use it everywhere, with any drawing application without any special plugins for different graphic editors.  More »


All the contacts and projects

Dmitry Vasiliev (just.dmitry)

Related Links

Software for Visual Studio .NET developers
Software for Delphi and C++ Builder developers
Software for Visual Basic 6 developers
Delphi Tips&Tricks
MegaDetailed.NET

More Online Helps

Win32 Programmer's Reference
Win32 Multimedia Programmer's Reference
OLE Programmer's Reference
Microsoft Windows Pen API Programmer's Reference
Microsoft Windows Sockets 2 Reference
Microsoft Windows Telephony API (TAPI) Programmer's Reference
Unix Manual Pages

Free Tech Secrets ;) Copyright © 2008-2011 Free Tech Secrets ;) greatis just4fun network just4fun