Sophie

Sophie

distrib > Mandriva > 2009.1 > x86_64 > by-pkgid > 56c615211d295fb99ff45dd87fd8e366 > files > 227

lib64allegro-devel-4.2.2-4mdv2009.1.x86_64.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html><head><title>
Allegro Manual: Windows specifics
</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<link rel="stylesheet" title="Default" type="text/css" href="allegro.css"></head><body bgcolor=white text=black link="#0000ee" alink="#ff0000" vlink="#551a8b">
<h1><a name="Windows specifics">Windows specifics</a></h1>

<ul>
<li><a href="#blit_from_hdc">blit_from_hdc</a> &mdash; Blits from a Windows device context to an Allegro memory bitmap.
<li><a href="#blit_to_hdc">blit_to_hdc</a> &mdash; Blits an Allegro memory bitmap to a Windows device context.
<li><a href="#convert_bitmap_to_hbitmap">convert_bitmap_to_hbitmap</a> &mdash; Converts an Allegro memory bitmap to a Windows DDB.
<li><a href="#convert_hbitmap_to_bitmap">convert_hbitmap_to_bitmap</a> &mdash; Creates an Allegro memory bitmap from a Windows DDB.
<li><a href="#convert_hpalette_to_palette">convert_hpalette_to_palette</a> &mdash; Converts a Windows palette to an Allegro palette.
<li><a href="#convert_palette_to_hpalette">convert_palette_to_hpalette</a> &mdash; Converts an Allegro palette to a Windows palette.
<li><a href="#DIGI_*/Windows">DIGI_*/Windows</a> &mdash; Supported Windows digital sound drivers.
<li><a href="#draw_to_hdc">draw_to_hdc</a> &mdash; Draws an Allegro bitmap to a Windows device context.
<li><a href="#GFX_*/Windows">GFX_*/Windows</a> &mdash; Supported Windows graphic drivers.
<li><a href="#JOY_TYPE_*/Windows">JOY_TYPE_*/Windows</a> &mdash; Supported Windows joystick drivers.
<li><a href="#MIDI_*/Windows">MIDI_*/Windows</a> &mdash; Supported Windows MIDI sound drivers.
<li><a href="#set_gdi_color_format">set_gdi_color_format</a> &mdash; Tells Allegro to use the GDI color layout for truecolor images.
<li><a href="#set_palette_to_hdc">set_palette_to_hdc</a> &mdash; Selects and realizes a palette on the specified device context.
<li><a href="#stretch_blit_from_hdc">stretch_blit_from_hdc</a> &mdash; Blits from a Windows device context to an Allegro memory bitmap.
<li><a href="#stretch_blit_to_hdc">stretch_blit_to_hdc</a> &mdash; Blits an Allegro memory bitmap to a Windows device context.
<li><a href="#win_get_dc">win_get_dc</a> &mdash; Retrieves a handle to the device context.
<li><a href="#win_get_window">win_get_window</a> &mdash; Retrieves a handle to the window used by Allegro.
<li><a href="#win_release_dc">win_release_dc</a> &mdash; Releases a handle to the device context.
<li><a href="#win_set_window">win_set_window</a> &mdash; Registers an user-created window to be used by Allegro.
<li><a href="#win_set_wnd_create_proc">win_set_wnd_create_proc</a> &mdash; Registers a custom procedure to be used by Allegro for creating its window.
</ul>

<p>
In terms of file redistribution, the Windows platform behaves practically the
same as the DOS platform. Read section chapter "Dos specifics" in the manual
to learn more about this.

<p>
A Windows program that uses the Allegro library is only required to include
one or more header files from the include/allegro tree, or allegro.h; however,
if it also needs to directly call non portable Win32 API functions, it must
include the Windows-specific header file winalleg.h after the Allegro headers,
and before any Win32 API header file. By default winalleg.h includes the main
Win32 C API header file windows.h. If instead you want to use the C++
interface to the Win32 API (a.k.a. the Microsoft Foundation Classes), define
the preprocessor symbol ALLEGRO_AND_MFC before including any Allegro header
so that afxwin.h will be included. Note that, in this latter case, the Allegro
debugging macros ASSERT() and TRACE() are renamed AL_ASSERT() and AL_TRACE()
respectively.

<p>
Windows GUI applications start with a WinMain() entry point, rather than the
standard main() entry point. Allegro is configured to build GUI applications
by default and to do some magic in order to make a regular main() work with
them, but you have to help it out a bit by writing END_OF_MAIN() right after
your main() function. If you don't want to do that, you can just include
winalleg.h and write a WinMain() function. Note that this magic may bring
about conflicts with a few programs using direct calls to Win32 API
functions; for these programs, the regular WinMain() is required and the
magic must be disabled by defining the preprocessor symbol
ALLEGRO_NO_MAGIC_MAIN before including Allegro headers.

<p>
If you want to build a console application using Allegro, you have to define
the preprocessor symbol ALLEGRO_USE_CONSOLE before including Allegro headers;
it will instruct the library to use console features and also to disable the
special processing of the main() function described above.

<p>
When creating the main window, Allegro searches the executable for an ICON 
resource named "allegro_icon". If it is present, Allegro automatically
loads it and uses it as its application icon; otherwise, Allegro uses the 
default IDI_APPLICATION icon. See the manual of your compiler for a method 
to create an ICON resource, or use the wfixicon utility from the tools/win 
directory.

<p>
DirectX requires that system and video bitmaps (including the screen) be 
locked before you can draw onto them. This will be done automatically, but 
you can usually get much better performance by doing it yourself: see the 
acquire_bitmap() function for details.

<p>
Due to a major oversight in the design of DirectX, there is no way to 
preserve the contents of video memory when the user switches away from your 
program. You need to be prepared for the fact that your screen contents, and 
the contents of any video memory bitmaps, may be destroyed at any point. You 
can use the set_display_switch_callback() function to find out when this 
happens.

<p>
On the Windows platform, the only return values for the desktop_color_depth()
function are 8, 16, 24 and 32. This means that 15-bit and 16-bit desktops 
cannot be differentiated and are both reported as 16-bit desktops. See
below for the consequences for windowed and overlay DirectX drivers.

<p><br>
<div class="al-api"><b>Drivers <a name="JOY_TYPE_*/Windows">JOY_TYPE_*/Windows</a></b></div><br>
   The Windows library supports the following type parameters for the 
   install_joystick() function:
<ul><li>
   JOY_TYPE_AUTODETECT<br>
      Attempts to autodetect your joystick hardware. It will use information 
      from the configuration file if one is available (this can be created 
      using the setup utility or by calling the save_joystick_data()
      function), so you can always use JOY_TYPE_AUTODETECT in your code and
      then select the exact hardware type from the setup program.
<li>
   JOY_TYPE_NONE<br>
      Dummy driver for machines without any joystick.
<li>
   JOY_TYPE_DIRECTX<br>
      Use DirectInput to access the joystick.
<li>
   JOY_TYPE_WIN32<br>
      Use the regular Win32 interface rather than DirectInput to access the
      joystick.
</ul>


<blockquote class="xref"><em><b>See also:</b></em>
<a class="xref" href="alleg007.html#install_joystick" title="Initialises the joystick.">install_joystick</a>.</blockquote>
<div class="al-api"><b>Drivers <a name="GFX_*/Windows">GFX_*/Windows</a></b></div><br>
   The Windows library supports the following card parameters for the 
   set_gfx_mode() function:
<ul><li>
   GFX_TEXT<br>
      This closes any graphics mode previously opened with set_gfx_mode.
<li>
   GFX_AUTODETECT<br>
      Let Allegro pick an appropriate graphics driver.
<li>
   GFX_AUTODETECT_FULLSCREEN<br>
      Autodetects a graphics driver, but will only use fullscreen drivers,
      failing if these are not available on current platform.
<li>
   GFX_AUTODETECT_WINDOWED<br>
      Same as above, but uses only windowed drivers.
<li>
   GFX_SAFE<br>
      Special driver for when you want to reliably set a graphics mode and 
      don't really care what resolution or color depth you get. See the
      set_gfx_mode() documentation for details.
<li>
   GFX_DIRECTX<br>
      Alias for GFX_DIRECTX_ACCEL.
<li>
   GFX_DIRECTX_ACCEL<br>
      The regular fullscreen DirectX driver, running with hardware 
      acceleration enabled.
<li>
   GFX_DIRECTX_SOFT<br>
      DirectX fullscreen driver that only uses software drawing, rather than 
      any hardware accelerated features.
<li>
   GFX_DIRECTX_SAFE<br>
      Simplified fullscreen DirectX driver that doesn't support any hardware 
      acceleration, video or system bitmaps, etc.
<li>
   GFX_DIRECTX_WIN<br>
      The regular windowed DirectX driver, running in color conversion mode 
      when the color depth doesn't match that of the Windows desktop. Color 
      conversion is much slower than direct drawing and is not supported 
      between 15-bit and 16-bit color depths. This limitation is needed to 
      work around that of desktop_color_depth() (see above) and allows to 
      select the direct drawing mode in a reliable way on desktops reported 
      as 16-bit:
<blockquote class="code"><pre>
         if (<a href="alleg000.html#desktop_color_depth" class="autotype" title="Finds out the desktop color depth.">desktop_color_depth</a>() == 16) {
            <a href="alleg008.html#set_color_depth" class="autotype" title="Sets the global pixel color depth.">set_color_depth</a>(16);
            if (<a href="alleg008.html#set_gfx_mode" class="autotype" title="Sets a graphic video mode.">set_gfx_mode</a>(GFX_DIRECTX_WIN, 640, 480, 0, 0)
                != 0) {
               <a href="alleg008.html#set_color_depth" class="autotype" title="Sets the global pixel color depth.">set_color_depth</a>(15);
               if (<a href="alleg008.html#set_gfx_mode" class="autotype" title="Sets a graphic video mode.">set_gfx_mode</a>(GFX_DIRECTX_WIN, 640, 480, 0, 0)
                   != 0) {
                  /* 640x480 direct drawing mode not supported */
                  goto Error;
               }
            }
            /* ok, we are in direct drawing mode */
         }
</pre></blockquote>
      Note that, mainly for performance reasons, this driver requires the
      width of the screen to be a multiple of 4.
      This driver is capable of displaying a hardware cursor, but there are
      size restrictions. Typically, the cursor image cannot be more than
      32x32 pixels.
<li>
   GFX_DIRECTX_OVL<br>
      The DirectX overlay driver. It uses special hardware features to run 
      your program in a windowed mode: it doesn't work on all hardware, but 
      performance is excellent on cards that are capable of it. It requires 
      the color depth to be the same as that of the Windows desktop. In light 
      of the limitation of desktop_color_depth() (see above), the reliable 
      way of setting the overlay driver on desktops reported as 16-bit is:
<blockquote class="code"><pre>
         if (<a href="alleg000.html#desktop_color_depth" class="autotype" title="Finds out the desktop color depth.">desktop_color_depth</a>() == 16) {
            <a href="alleg008.html#set_color_depth" class="autotype" title="Sets the global pixel color depth.">set_color_depth</a>(16);
            if (<a href="alleg008.html#set_gfx_mode" class="autotype" title="Sets a graphic video mode.">set_gfx_mode</a>(GFX_DIRECTX_OVL, 640, 480, 0, 0)
                != 0) {
               <a href="alleg008.html#set_color_depth" class="autotype" title="Sets the global pixel color depth.">set_color_depth</a>(15);
               if (<a href="alleg008.html#set_gfx_mode" class="autotype" title="Sets a graphic video mode.">set_gfx_mode</a>(GFX_DIRECTX_OVL, 640, 480, 0, 0)
                   != 0) {
                  /* 640x480 overlay driver not supported */
                  goto Error;
               }
            }
            /* ok, the 640x480 overlay driver is running */
         }</pre></blockquote>
<li>
   GFX_GDI<br>
      The windowed GDI driver. It is extremely slow, but is guaranteed to 
      work on all hardware, so it can be useful for situations where you 
      want to run in a window and don't care about performance. Note that 
      this driver features a hardware mouse cursor emulation in order to 
      speed up basic mouse operations (like GUI operations).
</ul>

<blockquote class="xref"><em><b>See also:</b></em>
<a class="xref" href="alleg008.html#set_gfx_mode" title="Sets a graphic video mode.">set_gfx_mode</a>.</blockquote>
<div class="al-api"><b>Drivers <a name="DIGI_*/Windows">DIGI_*/Windows</a></b></div><br>
   The Windows sound functions support the following digital sound cards:
<blockquote class="text"><pre>
      DIGI_AUTODETECT      - let Allegro pick a digital sound driver
      DIGI_NONE            - no digital sound
      DIGI_DIRECTX(n)      - use DirectSound device #n (zero-based)
                             with direct mixing
      DIGI_DIRECTAMX(n)    - use DirectSound device #n (zero-based)
                             with Allegro mixing
      DIGI_WAVOUTID(n)     - high (n=0) or low (n=1) quality WaveOut
                             device</pre></blockquote>


<blockquote class="xref"><em><b>See also:</b></em>
<a class="xref" href="alleg024.html#detect_digi_driver" title="Detects whether the specified digital sound device is available.">detect_digi_driver</a>,
<a class="xref" href="alleg024.html#install_sound" title="Initialises the sound module.">install_sound</a>,
<a class="xref" href="alleg029.html#install_sound_input" title="Initialises the sound recorder module.">install_sound_input</a>.</blockquote>
<div class="al-api"><b>Drivers <a name="MIDI_*/Windows">MIDI_*/Windows</a></b></div><br>
   The Windows sound functions support the following MIDI sound cards:
<blockquote class="text"><pre>
      MIDI_AUTODETECT      - let Allegro pick a MIDI sound driver
      MIDI_NONE            - no MIDI sound
      MIDI_WIN32MAPPER     - use win32 MIDI mapper
      MIDI_WIN32(n)        - use win32 device #n (zero-based)
      MIDI_DIGMID          - sample-based software wavetable player</pre></blockquote>


<blockquote class="xref"><em><b>See also:</b></em>
<a class="xref" href="alleg024.html#detect_midi_driver" title="Detects whether the specified MIDI sound device is available.">detect_midi_driver</a>,
<a class="xref" href="alleg024.html#install_sound" title="Initialises the sound module.">install_sound</a>,
<a class="xref" href="alleg029.html#install_sound_input" title="Initialises the sound recorder module.">install_sound_input</a>.</blockquote>
<br><center><h2><a name="Windows integration routines">Windows integration routines</a></h2></center><p>

<p>
The following functions provide a platform specific interface to seamlessly 
integrate Allegro into general purpose Win32 programs. To use these routines, 
you must include winalleg.h after other Allegro headers.

<p><br>
<div class="al-api"><b>HWND <a name="win_get_window">win_get_window</a>(void);</b></div><br>
   Retrieves a handle to the window used by Allegro. Note that Allegro
   uses an underlying window even though you don't set any graphics mode,
   unless you have installed the neutral system driver (SYSTEM_NONE).

<p><br>
<div class="al-api"><b>void <a name="win_set_window">win_set_window</a>(HWND wnd);</b></div><br>
   Registers an user-created window to be used by Allegro. This function is
   meant to be called before initialising the library with allegro_init()
   or installing the autodetected system driver (SYSTEM_AUTODETECT). It
   lets you attach Allegro to any already existing window and prevents the
   library from creating its own, thus leaving you total control over the
   window; in particular, you are responsible for processing the events as
   usual (Allegro will automatically monitor a few of them, but will not
   filter out any of them). You can then use every component of the library
   (graphics, mouse, keyboard, sound, timers and so on), bearing in mind
   that some Allegro functions are blocking (e.g. readkey() if the key buffer
   is empty) and thus must be carefully manipulated by the window thread.

<p>
   However you can also call it after the library has been initialised,
   provided that no graphics mode is set. In this case the keyboard, mouse,
   joystick, sound and sound recording modules will be restarted.

<p>
   Passing NULL instructs Allegro to switch back to its built-in window if
   an user-created window was registered, or to request a new handle from
   Windows for its built-in window if this was already in use.

<p><br>
<div class="al-api"><b>void <a name="win_set_wnd_create_proc">win_set_wnd_create_proc</a>(HWND (*proc)(WNDPROC));</b></div><br>
   Registers an user-defined procedure to be used by Allegro for creating
   its window. This function must be called *before* initializing the
   library with allegro_init() or installing the autodetected system
   driver (SYSTEM_AUTODETECT). It lets you customize Allegro's window but
   only by its creation: unlike with win_set_window(), you have no control
   over the window once it has been created (in particular, you are not
   responsible for processing the events). The registered function will be
   passed a window procedure (WNDPROC object) that it must make the 
   procedure of the new window of and it must return a handle to the new 
   window. You can then use the full-featured library in the regular way.

<p><br>
<div class="al-api"><b>HDC <a name="win_get_dc">win_get_dc</a>(<a class="autotype" href="alleg001.html#BITMAP" title="Stores the contents of a bitmap.">BITMAP</a> *bmp);</b></div><br>
   Retrieves a handle to the device context of a DirectX video or system
   bitmap.

<p><br>
<div class="al-api"><b>void <a name="win_release_dc">win_release_dc</a>(<a class="autotype" href="alleg001.html#BITMAP" title="Stores the contents of a bitmap.">BITMAP</a> *bmp, HDC dc);</b></div><br>
   Releases a handle to the device context of the bitmap that was
   previously retrieved with win_get_dc().

<p>
<br><center><h2><a name="GDI routines">GDI routines</a></h2></center><p>

<p>
The following GDI routines are a very platform specific thing, to allow 
drawing Allegro memory bitmaps onto a Windows device context. When you want 
to use this, you'll have to install the neutral system driver (SYSTEM_NONE) 
or attach Allegro to an external window with win_set_window().

<p>
There are two ways to draw your Allegro bitmaps to the Windows GDI. When you 
are using static bitmaps (for example just some pictures loaded from a 
datafile), you can convert them to DDB (device-dependent bitmaps) with 
convert_bitmap_to_hbitmap() and then just use Win32's BitBlt() to draw it.

<p>
When you are using dynamic bitmaps (for example some things which react to 
user input), it's better to use set_palette_to_hdc() and blit_to_hdc() 
functions, which work with DIB (device-independent bitmaps).

<p>
There are also functions to blit from a device context into an Allegro 
BITMAP, so you can do things like screen capture.

<p>
All the drawing and conversion functions use the current palette as a color 
conversion table. You can alter the current palette with the 
set_palette_to_hdc() or select_palette() functions. Warning: when the GDI 
system color palette is explicitly changed, (by another application, for 
example) the current Allegro palette is not updated along with it!

<p>
To use these routines, you must include winalleg.h after Allegro headers.

<p><br>
<div class="al-api"><b>void <a name="set_gdi_color_format">set_gdi_color_format</a>(void);</b></div><br>
   Tells Allegro to use the GDI color layout for truecolor images. This is 
   optional, but it will make the conversions work faster. If you are going 
   to call this, you should do it right after initialising Allegro and 
   before creating any graphics.

<p><br>
<div class="al-api"><b>void <a name="set_palette_to_hdc">set_palette_to_hdc</a>(HDC dc, <a class="autotype" href="alleg001.html#PALETTE" title="Stores palette information.">PALETTE</a> pal);</b></div><br>
   Selects and realizes an Allegro palette on the specified device context.

<p><br>
<div class="al-api"><b>HPALETTE <a name="convert_palette_to_hpalette">convert_palette_to_hpalette</a>(<a class="autotype" href="alleg001.html#PALETTE" title="Stores palette information.">PALETTE</a> pal);</b></div><br>
   Converts an Allegro palette to a Windows palette and returns a handle to 
   it. You should call DeleteObject() when you no longer need it.


<blockquote class="xref"><em><b>See also:</b></em>
<a class="xref" href="#convert_hpalette_to_palette" title="Converts a Windows palette to an Allegro palette.">convert_hpalette_to_palette</a>.</blockquote>
<div class="al-api"><b>void <a name="convert_hpalette_to_palette">convert_hpalette_to_palette</a>(HPALETTE hpal, <a class="autotype" href="alleg001.html#PALETTE" title="Stores palette information.">PALETTE</a> pal);</b></div><br>
   Converts a Windows palette to an Allegro palette.


<blockquote class="xref"><em><b>See also:</b></em>
<a class="xref" href="#convert_palette_to_hpalette" title="Converts an Allegro palette to a Windows palette.">convert_palette_to_hpalette</a>.</blockquote>
<div class="al-api"><b>HBITMAP <a name="convert_bitmap_to_hbitmap">convert_bitmap_to_hbitmap</a>(<a class="autotype" href="alleg001.html#BITMAP" title="Stores the contents of a bitmap.">BITMAP</a> *bitmap);</b></div><br>
   Converts an Allegro memory bitmap to a Windows DDB and returns a handle 
   to it. This bitmap uses its own memory, so you can destroy the original 
   bitmap without affecting the converted one. You should call 
   DeleteObject() when you no longer need this bitmap.


<blockquote class="xref"><em><b>See also:</b></em>
<a class="xref" href="#convert_hbitmap_to_bitmap" title="Creates an Allegro memory bitmap from a Windows DDB.">convert_hbitmap_to_bitmap</a>.</blockquote>
<div class="al-api"><b><a class="autotype" href="alleg001.html#BITMAP" title="Stores the contents of a bitmap.">BITMAP</a> *<a name="convert_hbitmap_to_bitmap">convert_hbitmap_to_bitmap</a>(HBITMAP bitmap);</b></div><br>
   Creates an Allegro memory bitmap from a Windows DDB.


<blockquote class="xref"><em><b>See also:</b></em>
<a class="xref" href="#convert_bitmap_to_hbitmap" title="Converts an Allegro memory bitmap to a Windows DDB.">convert_bitmap_to_hbitmap</a>.</blockquote>
<div class="al-api"><b>void <a name="draw_to_hdc">draw_to_hdc</a>(HDC dc, <a class="autotype" href="alleg001.html#BITMAP" title="Stores the contents of a bitmap.">BITMAP</a> *bitmap, int x, int y);</b></div><br>
   Draws an entire Allegro bitmap to a Windows device context, using the 
   same parameters as the draw_sprite() function.


<blockquote class="xref"><em><b>See also:</b></em>
<a class="xref" href="#blit_to_hdc" title="Blits an Allegro memory bitmap to a Windows device context.">blit_to_hdc</a>,
<a class="xref" href="#stretch_blit_to_hdc" title="Blits an Allegro memory bitmap to a Windows device context.">stretch_blit_to_hdc</a>,
<a class="xref" href="alleg014.html#draw_sprite" title="Draws a copy of the sprite onto the destination bitmap.">draw_sprite</a>.</blockquote>
<div class="al-api"><b>void <a name="blit_to_hdc">blit_to_hdc</a>(<a class="autotype" href="alleg001.html#BITMAP" title="Stores the contents of a bitmap.">BITMAP</a> *bitmap, HDC dc, int sx, sy, dx, dy, w, h);</b></div><br>
   Blits an Allegro memory bitmap to a Windows device context, using the 
   same parameters as the blit() function.


<blockquote class="xref"><em><b>See also:</b></em>
<a class="xref" href="#draw_to_hdc" title="Draws an Allegro bitmap to a Windows device context.">draw_to_hdc</a>,
<a class="xref" href="#stretch_blit_to_hdc" title="Blits an Allegro memory bitmap to a Windows device context.">stretch_blit_to_hdc</a>,
<a class="xref" href="#blit_from_hdc" title="Blits from a Windows device context to an Allegro memory bitmap.">blit_from_hdc</a>,
<a class="xref" href="alleg014.html#blit" title="Copies a rectangular area from one bitmap to another.">blit</a>.</blockquote>
<div class="al-api"><b>void <a name="stretch_blit_to_hdc">stretch_blit_to_hdc</a>(<a class="autotype" href="alleg001.html#BITMAP" title="Stores the contents of a bitmap.">BITMAP</a> *bitmap, HDC dc, int sx, sy, sw, sh,
                                                 int dx, dy, dw, dh);</b></div><br>
   Blits an Allegro memory bitmap to a Windows device context, using the 
   same parameters as the stretch_blit() function.


<blockquote class="xref"><em><b>See also:</b></em>
<a class="xref" href="#draw_to_hdc" title="Draws an Allegro bitmap to a Windows device context.">draw_to_hdc</a>,
<a class="xref" href="#blit_to_hdc" title="Blits an Allegro memory bitmap to a Windows device context.">blit_to_hdc</a>,
<a class="xref" href="#stretch_blit_from_hdc" title="Blits from a Windows device context to an Allegro memory bitmap.">stretch_blit_from_hdc</a>,
<a class="xref" href="alleg014.html#stretch_blit" title="Scales a rectangular area from one bitmap to another.">stretch_blit</a>.</blockquote>
<div class="al-api"><b>void <a name="blit_from_hdc">blit_from_hdc</a>(HDC hdc, <a class="autotype" href="alleg001.html#BITMAP" title="Stores the contents of a bitmap.">BITMAP</a> *bitmap, int sx, sy, dx, dy, w, h);</b></div><br>
   Blits from a Windows device context to an Allegro memory bitmap, using 
   the same parameters as the blit() function. See stretch_blit_from_hdc() 
   for details.


<blockquote class="xref"><em><b>See also:</b></em>
<a class="xref" href="#stretch_blit_from_hdc" title="Blits from a Windows device context to an Allegro memory bitmap.">stretch_blit_from_hdc</a>,
<a class="xref" href="#blit_to_hdc" title="Blits an Allegro memory bitmap to a Windows device context.">blit_to_hdc</a>,
<a class="xref" href="alleg014.html#blit" title="Copies a rectangular area from one bitmap to another.">blit</a>.</blockquote>
<div class="al-api"><b>void <a name="stretch_blit_from_hdc">stretch_blit_from_hdc</a>(HDC hcd, <a class="autotype" href="alleg001.html#BITMAP" title="Stores the contents of a bitmap.">BITMAP</a> *bitmap, int sx, sy, sw, sh,
                                                    int dx, dy, dw, dh);</b></div><br>
   Blits from a Windows device context to an Allegro memory bitmap, using 
   the same parameters as the stretch_blit() function. It uses the current 
   Allegro palette and does conversion to this palette, regardless of the 
   current DC palette. So if you are blitting from 8-bit mode, you should 
   first set the DC palette with the set_palette_to_hdc() function.



<blockquote class="xref"><em><b>See also:</b></em>
<a class="xref" href="#blit_from_hdc" title="Blits from a Windows device context to an Allegro memory bitmap.">blit_from_hdc</a>,
<a class="xref" href="#stretch_blit_to_hdc" title="Blits an Allegro memory bitmap to a Windows device context.">stretch_blit_to_hdc</a>,
<a class="xref" href="alleg014.html#stretch_blit" title="Scales a rectangular area from one bitmap to another.">stretch_blit</a>.</blockquote>
<hr><div class="al-back-to-contents"><a href="allegro.html">Back to contents</a></div>

</body>
</html>