Drawdib function group

Source: Internet
Author: User
Microsoft provides a set of high-performance function groups, drawdib, for device-independent bitmaps (DIB bitmaps) in its Win32 SDK multimedia. The drawdib function group is a set of function groups that directly operate on the memory without relying on the graphical device interface (GDI) function. They support Dib with 8-bit, 16-bit, 24-bit, and 32-bit image depth. In general, the drawdib function group is similar to the stretchdibits function, which provides the ability to stretch and shake images. However, the drawdib function group also supports image decompression, data streams, and more display adapters. In some cases, the drawdib function group has greater superiority. However, in some cases, the drawdib function group cannot replace the stretchdibits function. The following describes the differences between the drawdib function group and the stretchdibits function:

Color information table format. The drawdib function group only supports images in dib_rgb_colors format. To display images in dib_pal_colors or dib_pal_indices format, you must use the stretchdibits function.
Grating operation mode. The drawdib function group can only use the srccopy grating operation mode. If you require not only the srccopy mode, you can only use the stretchdibits function. Similarly, if you want to use other grating operations, such as XOR, you can only use the stretchdibits function.
Quality of video and animation playback. The drawdib function group supports data stream applications, such as video and animation sequences. It provides higher image quality and improved playback process than the stretchdibits function.
Display the adapter. The drawdib function group supports more display adapters than the stretchdibits function. The drawdib Function Group supports the use of a 4-bit image depth to provide a 16-color palette VGA adapter, svga adapters with a 256 color palette and true color adapters with a 16-bit, 24-bit, and 32-bit image depth are available in thousands of colors. The drawdib function group also uses limited potential capabilities to improve the speed and quality of images on the display adapter. For example, when an 8-bit display adapter is used, the drawdib function group effectively changes the true color image to 256 colors. Similarly, when a 4-bit display adapter is used, they also shake 8-bit deep images into four digits.
Image stretching. Just like stretchdibits, The drawdib function group uses the source rectangle and the destination rectangle to control the display part of an image. You can crop unnecessary parts of an image and stretch some parts by changing the position and size of the source and target rectangles. If the display driver does not support image stretching, The drawdib function group provides more effective stretching capabilities than the stretchdibits function.
Compress the image. The drawdib function group supports several compression and decompression methods, including program encoding, JPEG, cinepak, 411yuv, and Indeo & #8482 ;.
Drawdib operations

Use the drawdibopen function to initialize the drawdib function group. Drawdibopen is responsible for loading the dynamic connection library (DLL), applying for memory resources, drawdib device environment (DC), and maintaining the environment count of initialization-related devices. Drawdibopen returns the new DC handle required by another drawdib function.

After using drawdib DC, you can use the drawdibclose function to release it. Drawdibclose also reduces the number of applications that access the DLL. In the application, the drawdibclose function should be the final drawdib operation.

You can create any number of drawdib DC, or use multiple drawdib DC to draw several bitmaps at the same time. You can create multiple drawdib DC of different nature in the application, so that you can select the most appropriate DC settings. For example, in the same application, create two different drawdib DC, one for displaying the normal resolution of the image, and the other for displaying the enlarged part of the image.

To run it more effectively, the drawdib function group needs to know the information about the adapter and its driver. The configuration information is displayed after the display adapter passes a series of tests when the DLL containing the drawdib function group is used for the first time. This configuration is required for all applications in the drawdib function group. You can force these tests to be re-performed by calling the drawdibprofiledisplay function.

Generally, obtaining and saving the display configuration is a one-time event. If the configuration information shows that another display driver is installed in this system, drawdib will perform the test again.

 

Image reproduction

After the drawdib DC is created, you can use the drawdibdraw function to draw the DIB to the screen. When a true color image is displayed on an 8-bit depth display adapter, drawdib automatically jitters the image.

Drawdib also supports video compressors transparently. When a compressed bitmap is displayed, you can use the drawdibgetbuffer function to obtain a buffer that contains the compressed image data. If the bitmap is uncompressed, drawdibgetbuffer returns NULL. In the application, you should distinguish whether bitmap is compressed.

You can use the drawdibupdate macro to refresh the overall or partial display of an image.

Image Sequence

When the drawdibdraw function is used with the drawdibbegin function, bitmap sequences of the same size and format can be displayed. Drawdib uses drawdibbegin to prepare the drawdib DC for drawing to improve the efficiency of drawdibdraw. If the application does not call drawdibbegin, drawdibdraw implicitly executes drawdibbegin before drawing.

Drawdibbegin provides drawdibdraw with the DC, DC handle, bitmapinfoheader structure address, source rectangle, and target rectangle size for drawdib. To display a bitmap sequence, drawdibdraw checks the values of each image in the sequence. If drawdibdraw detects any changes to these values, it implicitly calls drawdibbegin again to adjust the setting of drawdib DC.

After calling drawdibbegin, you can specify one or more appropriate labels to call drawdibdraw to draw image sequences. If the DC handle is not changed, you can specify the ddf_same_hdc flag. If the following parameters are not changed, you can specify the ddf_same_draw flag: Address of the bitmapinfoheader structure and size of the source and target rectangles.

You can call drawdibend with another drawdibbegin to update the flag set for the previous drawdibbegin. Drawdibend clears the flag and settings of the current drawdib DC. Subsequent calls to drawdibbegin will reinitialize the drawdib DC and reset the appropriate flag and settings. However, if at least one of the following current flag settings is changed: the address of the bitmapinfoheader structure, or the size of the source or destination rectangle, you can also directly call drawdibbegin instead of drawdibend to update a drawdib DC.

By using the drawdibstart and drawdibstop functions, you can improve the efficiency of drawdibdraw by compressing the data stream operations of images (such as playing back a video. Drawdibstart sends a message to the video manager (VCM) to prepare the drawdib DC to accept an image stream. When the stream ends, drawdibstop sends a message to VCM indicating that it releases the requested resource.

Note that the width and height of the Source and Destination rectangles must be determined in the application, but the start point of these rectangles is not required. The application can re-use the start coordinate in drawdibdraw to use different parts of the image or update different parts of the display.

The drawdib function group must respond to two palette messages: wm_querynewpalette and wm_palettechanged. If the application does not notice the color palette, it needs to add a message for each of these messages.

You can use the drawdibrealize function to implement the current drawdib palette in the current DC. The palette should be implemented in response to the wm_querynewpalette and wm_palettechanged messages, or when the drawdibdraw function is used to display the preparation process of an image sequence.

You can use the drawdibsetpallette function to map an image with another palette. Drawdibsetpallette forces drawdib DC to use the specified palette, which affects the image quality. For example, an application that pays attention to the color palette may have implemented a color palette and needs to prevent drawdib from implementing its own color palette. The application can use drawdibsetpalette to notify the use of the drawdib palette.

You can use the drawdibgetpallette function to obtain a handle of the current foreground palette. If the application uses the current foreground color palette, it does not have full access to the color palette, and another application can invalidate the color palette handle. After use, the application should not release the palette, so that another application cannot use the palette.

You can use the drawdibchangpallete function to receive new color values for its palette drawdib. In the Code following drawdibchangpallete, you can specify a new value for the color palette. When drawdibchangpalette is called, if the ddf_animate flag is not set in drawdib DC, you can use drawdibrealize to change the color palette and drawdibdraw. If the ddf_animate flag is set in drawdib DC, you can use drawdibdraw or drawdibrealize to animation the color palette and the displayed bitmap color. You can use the drawdibend and drawdibbegin to specify the ddf_animate flag.

If the drawdib palette selected for DC is released, a GDI error is reported when DC uses the palette. Instead, you should use drawdibsetpalette to change the drawdib DC to use another palette after saving the gaps.

Since the following functions release the drawdib palette, it should not be used unless the palette is not selected by DC: drawdibend, drawdibclose, and drawdibbegin. Similarly, when the same drawdib DC is used, but different drawing parameters (lpbi, dxdst, dydst, dxsrc or dysrc) or different formats are specified, drawdibdraw also releases the palette.

Time Calculation

As part of application debugging, calling the drawdibtime function gives you some time required to completely repeat a specific number of drawdib operations. Drawdibtime:

Draw a bitmap
Decompress a bitmap
Jitters a bitmap
Stretch a bitmap
Use the bitblt function to transform a bitmap.
Use the strecthdibits function to transform a bitmap.
After the return value is obtained, drawdibtime resets the count and value of each operation.

Note that drawdibtime is only available in the debug version of The drawdib function.

Use of drawdib

Add color palette Message Processing

The following example describes how to process the wm_palettechanged and wm_querynewpalette messages. In this example, the drawdibrealize function is used to process the wm_querynewpalette message.

The application should make the drawdibdraw function redraw the image by making the target window invalid to respond to the wm_querynewpalette message. Use the drawdibrealize function to implement the color palette to respond to the wm_palettechanged message.

Case wm_palettechanged:
If (hwnd) wparam = hwnd)
Break;
Case wm_querynewpalette:
HDC = getdc (hwnd );
F = drawdibrealize (HDD, HDC, false)> 0;
Releasedc (hwnd, HDC );
If (f)
Invalidaterect (hwnd, null, true );
Break;

Display Device drawing

The following example uses the drawdibrealize function to prepare the drawdib DC before displaying a bitmap sequence.

HDC = getdc (hwnd );
Drawdibbegin (HDD, HDC, dxdest, dydest, lpbi, dxsrc, dysrc, null );
Drawdibrealize (HDD, HDC, fbackground );
Drawdibdraw (HDD, HDC, xdst, ydst, dxdst, dydst, lpbi, lpbits,
Xsrc, ysrc, dxsrc, dysrc, ddf_same_draw | ddf_same_hdc );
Drawdibdraw (HDD, HDC, xdst, ydst, dxdst, dydst, lpbi, lpbits,
Xsrc, ysrc, dxsrc, dysrc, ddf_same_draw | ddf_same_hdc );
Drawdibdraw (HDD, HDC, xdst, ydst, dxdst, dydst, lpbi, lpbits,
Xsrc, ysrc, dxsrc, dysrc, ddf_same_draw | ddf_same_hdc );
Releasedc (hwnd, HDC );

Palette Animation

The following uses the drawdibrealize, drawdibchangpalette, and drawdibdraw functions to demonstrate the palette animation.

The drawdibbegin function can be used together with the drawdibchangepalette function to change the color of a bitmap. First, specify the ddf_animate flag when calling drawdibbegin to allow the color palette to change. Then, use the drawdibchangepalette function to set the value of the color table from the palette entry.

For example, if lppe is the address of a paletteentry queue containing a new color and lpbi is the lpbitmapinfoheader structure used in drawdibbegin or drawdibdraw, the subsequent program segment updates the DiB's color table.

HDC = getdc (hwnd );
Drawdibbegin (HDD ,..., Ddf_animate );
Drawdibrealize (HDD, HDC, fbackground );
Drawdibdraw (HDD, HDC ,..., Ddf_same_draw | ddf_same_hdc );
// Call to change the color
Drawdibchangepalette (HDD, istart, ilen, lppe );
......
Releasedc (hwnd, HDC );

The following is a key example of an instance: (it passes through windows 95 or Windows NT in Visual C ++ 4.2 .)

Void ctestdrawdibview: ondraw (CDC * PDC)

{

Ctestdrawdibdoc * pdoc = getdocument (); // get the document pointer

Assert_valid (pdoc );

// Todo: Add draw code for native data here

M_dibmem = pdoc-> m_buf; // obtain the dib memory.

If (m_dibmem = NULL)

{

// Afxmessagebox ("error in m_dibmem ");

Return;

}

Uint offset = pdoc-> m_off; // get the dib data offset.

Int xdst, ydst, dxdst, dydst, xsrc, ysrc, dxsrc, dysrc;

Lpbitmapinfoheader lpbi;

Lpvoid lpdibmem;

Lpvoid lpbits = NULL;

// Get the windows width & height to get the window width and height

Rect;

Getclientrect (& rect );

Xdst = ydst = 0;

Dxdst = rect. Right-rect. Left;

Dydst = rect. Bottom-rect. Top;

// Get DiB info to get DiB Information

Xsrc = ysrc = 0;

Lpdibmem = globallock (m_dibmem); // lock the memory to get the pointer

Lpbi = (lpbitmapinfoheader) lpdibmem; // obtain the dib information.

Dxsrc = lpbi-> biwidth;

Dysrc = lpbi-> biheight;

Lpbits = (lpstr) lpdibmem + offset-sizeof (bitmapfileheader );

// Draw Dib plot Dib

HDC = NULL;

HDC = PDC-> m_hdc;

/*

// Using setdibtodevice uses the setdibtodevice function as the reference

Int line = setdibitstodevice (HDC,
Xdst,
Ydst,
Dxsrc,
Dysrc,
Xsrc,
Ysrc,
0,
Dysrc,
Lpdib, // lpbits,
(Lpbitmapinfo) lpbi,
Dib_rgb_colors );

If (0 = line)
{

Afxmessagebox ("error in setdibstodevice ");

}

*/

/*

// Using stretchdibits uses the stretchdibits function as a reference

Int line = stretchdibits (HDC,
Xdst,
Ydst,
Dxdst,
Dydst,
Xsrc,
Ysrc,
Dxsrc,
Dysrc,
Lpbits,
(Lpbitmapinfo) lpbi,
Dib_rgb_colors,
Srccopy );

If (0 = line)

{

Afxmessagebox ("error in setdibstodevice ");

}

*/

// Using drawdib use drawdib

// Set dawing flag to set the drawing flag

Uint wflags;

// For the significance of the flag, see the previous function reference. The following two flags can be used to draw images,
// The remaining flags cannot be painted in this case.

Wflags = ddf_dontdraw;

// Wflags = ddf_notkeyframe;

Hdrawdib HDD = drawdibopen ();

If (HDD! = NULL)

{

Bool suc = true;

// For specific parameters, see the previous function reference

Suc = drawdibdraw (HDD,
HDC,
Xdst,
Ydst,
Dxdst,
Dydst,
Lpbi,
Lpbits,
Xsrc,
Ysrc,
Dxsrc,
Dysrc,
Wflags );

If (Suc = false) afxmessagebox ("drawdib failed ");

/* // Time test

Drawdibtime time;

Drawdibtime (HDD, & time );

Char Buf [256];

Sprintf (BUF, "Count % d/ndraw % d/ndecompress % d/n
Dither % d/nstretch % d/nblt % d/n setdibits % d/N ",
Time. timecount, time. timedraw,
Time. timedecompress, time. timedither,
Time. timestretch, time. timeblt,
Time. timesetdibits );

Afxmessagebox (BUF );

*/

Drawdibclose (HDD );

}

Else

Afxmessagebox ("error in drawdibopen ");

Globalunlock (m_dibmem); // release the dib handle

}

 

Appendix: function reference:

Drawdibbegin

This drawdib function changes the parameter of a drawdib DC or initializes a new drawdib DC.

Bool drawdibbegin (

Hdrawdib HDD,

HDC,

Int dxdest,

Int dydest,

Lpbitmapinfoheader lpbi,

Int dxsrc,

Int dysrc,

Uint wflags

);

Parameters

HDD drawdib DC handle

The handle of the HDC drawing DC. This parameter is optional.

The width and height of the target rectangle in the mm_text mode.

Lpbi contains the address of the bitmapinfoheader structure in the image format. The Dib color table follows the image format, and the biheight member must be a positive value.

The width and height (in pixels) of the dxsrc and dysrc source rectangles ).

Available flag for wflags function call. The following values are defined:

Ddf_animate allows the palette animation. If this value is set, by setting the pc_reserved flag of the palpalentry member in the logpalette structure, drawdib saves as many entries as possible and calls the drawdibchangepalette function to implement palette animation. If the application uses the drawdibbegin function in coordination with the drawdibdraw function, it is best to set this value in drawdibbegin instead of drawdibdraw.

Ddf_backgroundpal is used as the background color palette, and the color palette used for the current display remains unchanged. (This value is mutually exclusive with ddf_same_hdc .)

Ddf_buffer enables drawdib to use screen buffering so that ddf_update can be used. This closes the understanding of the pressure and Direct screen painting. If drawdib cannot create an off-screen buffer, decompress Or directly paint the screen.

Ddf_dontdraw: The current image is not painted, but it has been decompressed. Ddf_update can be used to draw images later. This flag replaces the ddf_preroll flag.

Ddf_fullscreen is not supported.

Ddf_halftone shakes Dib into a standard palette regardless of the dib palette. If the application uses drawdibbegin to collaborate with drawdibdraw, set this value in drawdibbegin instead of drawdibdraw.

Ddf_justdrawit: Use GDI to draw the image. Do not decompress, stretch, or shake the image using the drawdib function. This actually denies the ability of drawdib to distinguish it from the strechdibits function.

Ddf_same_draw allows drawdibdraw to use the current drawing parameter. This value is used only when you use drawdibdraw or drawdibbegin, lpbi, dxdext, dydest, dxsrc, and dysrc are not changed. This flag replaces the ddf_same_dib and ddf_same_size flags.

Ddf_same_hdc uses the current DC handle and the palette associated with the current handle.

The cached image at the end of ddf_update needs to be drawn. If this value fails to be drawn, the buffered image is not valid and a new image must be specified before the display is updated.

Return Value

True is returned. Otherwise, false is returned.

Note that this function is intended to be painted to the dib of DC by lpbi. The image has been stretched to the size specified by dxdest and dydest. If dxdest and dydest are set to-1, DiB is drawn according to the original proportion.

You can re-use drawdibbegin to specify a new flag and change at least one of the following settings: dxdest, dydest, lpbi, dxsrc, or dysrc to update the drawdib DC flag.

If the drawdibbegin parameter is not changed, calling this function again will not work.

Drawdibchangepalette

This function sets the palette used to paint DiB.

Bool drawdibchangepalette (

Hdrawdib HDD,

Int istart,

Int ilen,

Lppaletteentry lppe

);

Parameters:

HDD drawdib DC handle.

Istart palette start count.

The number of ilen palette.

The address of the lppe palette array.

Return Value

True is returned. Otherwise, false is returned.

Note that this function changes the physical palette only when the current drawdib palette is implemented by calling the drawdibrealize function.

If the color table does not change, the drawdibdraw function that does not specify ddf_same_draw will call the drawdibbegin function implicitly next time.

Drawdibclose

This function closes a drawdib DC and releases the resource requested by drawdib.

Bool drawdibclose (

Hdrawdib HDD

);

Parameters

HDD drawdib DC handle.

Return Value

True is returned. Otherwise, false is returned.

Drawdibdraw

This function draws DIB to the screen.

Bool drawdibdraw (

Hdrawdib HDD,

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 drawdib DC handle.

Hdc dc handle.

Xdst and ydst are in the mm_text coordinate system, and the X and Y coordinates in the upper left corner of the target rectangle.

Dxdst and dydst are in the mm_text coordinate system, and the width and height of the target rectangle. If dxdst is-1, the width of the bitmap is used. If dydst is-1, the height of the bitmap is used.

Lpbi contains the address of the bitmapinfoheader structure in the image format. The Dib color table follows the format, and the biheight member must be a positive value. drawdibdraw cannot draw an inverted DiB.

Lpbits contains the buffer address of Bitmap.

In pixels, xsrc and ysrc are the X and Y coordinates in the upper left corner of the source rectangle. The coordinate (0, 0) is the upper left corner of the bitmap.

The width and height of the source rectangle are measured in pixels.

Wflags available drawing flag. The following values are defined:

Ddf_backgroundpal is used as the background color palette, and the color palette used for the current display remains unchanged. This value is valid only when ddf_same_hdc is not set.

Ddf_dontdraw: The current image has been decompressed but not painted. This flag replaces the ddf_preroll flag.

Ddf_fullscreen is not supported.

Ddf_halftone shakes Dib into a standard palette regardless of the dib palette. If the application uses drawdibbegin, set it in drawdibbegin instead of drawdibdraw.

Ddf_hurryup data does not need to be painted (it can be painted) and ddf_update ignores this information. Drawdib checks this value only when another frame needs to be constructed. Otherwise, this value is ignored.

This value is usually used to synchronize videos and audios. When synchronizing data, the application should use this value to send images to prevent the drive from buffering frames to extract subsequent frames.

Ddf_notkeyframe Dib data is not a key frame.

Ddf_same_hdc uses the current DC handle and the palette associated with the current handle.

Ddf_same_draw allows drawdibdraw to use the current drawing parameter. This value is used only when you use drawdibdraw or drawdibbegin, lpbi, dxdext, dydest, dxsrc, and dysrc are not changed. Drawdibdraw often checks these parameters. If they are changed, drawdibbegin prepares the drawdib DC for the drawing. This flag replaces the ddf_same_dib and ddf_same_size flags.

The cached image at the end of ddf_update needs to be drawn. If this value fails to be drawn, the buffered image is not valid and a new image must be specified before the display is updated.

Return Value

True is returned. Otherwise, false is returned.

Note ddf_dontdraw to decompress drawdibdraw without displaying an image. A sequence that calls drawdibdraw is to specify ddf_update to display images.

If drawdib DC does not specify a screen buffer, the specified ddf_dontdraw will cause the frame to be painted to the screen immediately. Sequence call drawdibdraw to specify ddf_update will fail.

Although ddf_updat and ddf_dontdraw can be set at different times, they can be used together to create off-screen images. After the off-screen image is complete, you can call drawdibdraw to display the image.

Drawdibend

This function clears the flag set by the drawdibbegin or drawdibdraw function and other settings of the drawdib DC.

Bool drawdibend (

Hdrawdib HDD

);

Parameters

The drawdib DC handle to be released by HDD.

Return Value

True is returned. Otherwise, false is returned.

Drawdibgetbuffer

This function clears the buffer address that drawdib uses to extract.

Lpvoid drawdibgetbuffer (

Hdrawdib HDD,

Lpbitmapinfoheader lpbi,

DWORD dwsize,

DWORD dwflags

);

Parameters

The drawdib DC handle to be released by HDD.

The address of the lpbi bitmapinfo structure. This structure is defined by the bitmapinfoheader structure and the 256 color palette used by the bitmap.

Dwsize refers to the byte size through the bitmapinfo structure of lpbi.

Dwflags is retained and must be 0.

Return Value

Return the buffer address or return NULL if no buffer is used. If lpbi is not null, it fills in a bitmapinfo structure that depicts the buffer.

Drawdibgetpalette

This function clears the palette used by drawdib DC.

Hpalette drawdibgetpalette (

Hdrawdib HDD

);

Parameters

The drawdib DC handle to be released by HDD.

Return Value

A palette handle is returned. Otherwise, null is returned.

Note that this function assumes that drawdib DC contains an effective color palette, which implies a condition that the call to this function must be performed after the drawdibdraw or drawdibbegin function.

Drawdibopen

This function opens the drawdib library to prepare for using and creating a drawing's drawdib DC.

Hdrawdib drawdibopen (void );

Parameters

This function does not require parameters.

Return Value

A drawdib DC handle is returned. Otherwise, it is null.

Note: When multiple Dibs are painted at the same time, a drawdib DC is created for each image on the screen at the same time.

Drawdibprofiledisplay

This function determines that the system settings are displayed when the drawdib function is used.

Bool drawdibprofiledisplay (

Lpbitmapinfoheader lpbi

);

Parameters

The bitmapinfoheader structure in which lpbi contains bitmap information. You can specify NULL to confirm that the configuration information is current. If the configuration information is not current, drawdib re-runs the configuration test to obtain the current configuration information. It makes no sense to set this parameter to null to call the value of drawdibprofiledisplay.

Return Value

The returned value indicates the fastest draw and stretch capabilities of the display system. If the bitmap format is not supported, the value is 0 or one or more of the following values:

Pd_can_draw_dib drawdib can plot images in this format. Stretching may be supported or not supported.

Pd_can_stretchdib drawdib can stretch or draw images in this format.

Pd_stretchdib _ Drawing labels OK stretchdibits uses this format to draw images that are not stretched faster than another method.

Pd_stretchdib _ 1_2_ OK stretchdibits uses this format to draw images that stretch at faster than the other method.

Pd_stretchdib _ rjn_ OK stretchdibits uses this format to draw images that stretch at 1: N faster than the other method.

Drawdibrealize

This function is used to implement the drawdib DC palette with the specified DC.

Uint drawdibrealize (

Hdrawdib HDD,

HDC,

Bool fbackground

);

Parameters

HDD drawdib DC handle.

HDC contains the DC handle of the palette.

Fbackground background color palette flag. If this value is not zero, this palette is the background palette. If the value is zero and the DC is connected to another window, the logical palette becomes the background palette when the window has input focus. (When the window style is cs_owndc or DC is obtained using the getdc function, a DC is connected to a window ).

Return Value

Return the entry value in the logical palette mapped to different values in the system palette. If an error occurs or no color is to be updated, 0 is returned.

Note:

Use the drawdibdraw function and specify the ddf_backgroundpal flag to select the drawdib DC color palette as the background color palette.

Drawdibsetpalette

This function sets the palette used to paint DiB.

Bool drawdibsetpalette (

Hdrawdib HDD,

Hpalette hpal

);

Parameters

HDD drawdib DC handle.

The handle of the hpal palette. If null is specified, the default palette is used.

Return Value

True is returned. Otherwise, false is returned.

Drawdibstart

The drawdibstart function prepares the drawdib DC for stream playback.

Bool drawdibstart (

Hdrawdib HDD,

Long Rate

);

Parameters

HDD drawdib DC handle.

The rate playback rate is measured in milliseconds per frame.

Return Value

True is returned. Otherwise, false is returned.

Drawdibstop

This function releases the resources occupied by drawdib DC for stream playback.

Bool drawdibstop (

Hdrawdib HDD

);

Parameters

HDD drawdib DC handle.

Return Value

True is returned. Otherwise, false is returned.

Drawdibtime

This function obtains information about the drawing operation time and debugging operation time.

Bool drawdibtime (

Hdrawdib HDD,

Lpdrawdibtime lpddtime

);

Parameters

HDD drawdib DC handle.

The structure address of lpddtime drawdibtime.

Return Value

True is returned. Otherwise, false is returned.

Note:

This function only exists in the debugging version of the W32 software development library.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.