Home   Index   About
Ultimate Pack


Custom Search
Overview
Group
Quick Info

DrawDibBegin

The DrawDib function changes parameters of a DrawDib DC or initializes a new DrawDib DC.

BOOL DrawDibBegin(

HDRAWDIB hdd,

HDC hdc,

int dxDest,

int dyDest,

LPBITMAPINFOHEADER lpbi,

int dxSrc,

int dySrc,

UINT wFlags

);

Parameters

hdd

Handle of a DrawDib DC.

hdc

Handle of a DC for drawing. This parameter is optional.

dxDest and dyDest

Width and height, in MM_TEXT client units, of the destination rectangle.

lpbi

Address of a BITMAPINFOHEADER structure containing the image format. The color table for the DIB follows the image format and the biHeight member must be a positive value.

dxSrc and dySrc

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

wFlags

Applicable flags for the function. The following values are defined:

DDF_ANIMATE

Allows palette animation. If this value is present, DrawDib reserves as many entries as possible by setting PC_RESERVED in the palPalEntry members of the LOGPALETTE structure, and the palette can be animated by using the DrawDibChangePalette function. If your application uses the DrawDibBegin function with the DrawDibDraw function, set this value with DrawDibBegin rather than DrawDibDraw.

DDF_BACKGROUNDPAL

Realizes the palette used for drawing as a background task, leaving the current palette used for the display unchanged. (This value is mutually exclusive of DDF_SAME_HDC.)

DDF_BUFFER

Causes DrawDib to try to use an off-screen buffer so DDF_UPDATE can be used. This disables decompression and drawing directly to the screen. If DrawDib is unable to create an off-screen buffer, it will decompress or draw directly to the screen. For more information, see the DDF_UPDATE and DDF_DONTDRAW values described for DrawDibDraw.

DDF_DONTDRAW

Current image is not drawn, but is decompressed. DDF_UPDATE can be used later to draw the image. 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 DrawDibBegin with DrawDibDraw, set this value with DrawDibBegin rather than DrawDibDraw.

DDF_JUSTDRAWIT

Draws the image by using GDI. Prohibits DrawDib functions from decompressing, stretching, or dithering the image. This strips DrawDib of capabilities that differentiate it from the StretchDIBits function.

DDF_SAME_DRAW

Use the current drawing parameters for DrawDibDraw. Use this value only if lpbi, dxDest, dyDest, dxSrc, and dySrc have not changed since using DrawDibDraw or DrawDibBegin. This flag supercedes the DDF_SAME_DIB and DDF_SAME_SIZE flags.

DDF_SAME_HDC

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

DDF_UPDATE

Last buffered bitmap needs 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

This function prepares to draw a DIB specified by lpbi to the DC. The image is stretched to the size specified by dxDest and dyDest. If dxDest and dyDest are set to pics/MMEDIA00090000.gif 1, the DIB is drawn to a 1:1 scale without stretching.

You can update the flags of a DrawDib DC by reissuing DrawDibBegin, specifying the new flags, and changing at least one of the following settings: dxDest, dyDest, lpbi, dxSrc, or dySrc.

If the parameters of DrawDibBegin have not changed, subsequent calls to the function have no effect.

See Also

BITMAPINFOHEADER
, LOGPALETTE, DrawDibChangePalette, DrawDibDraw, StretchDIBits


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