Partager via


Graphics::D rawCachedBitmap, méthode (gdiplusgraphics.h)

La méthode Graphics::D rawCachedBitmap dessine l’image stockée dans un objet CachedBitmap .

Syntaxe

Status DrawCachedBitmap(
  [in] CachedBitmap *cb,
  [in] INT          x,
  [in] INT          y
);

Paramètres

[in] cb

Type : CachedBitmap*

Pointeur vers un objet CachedBitmap qui contient l’image à dessiner.

[in] x

Type : INT

Entier qui spécifie la coordonnée x du coin supérieur gauche de l’image.

[in] y

Type : INT

Entier qui spécifie la coordonnée y du coin supérieur gauche de l’image.

Valeur retournée

Type : État

Si la méthode réussit, elle retourne Ok, qui est un élément de l’énumération Status .

Si la méthode échoue, elle retourne l’un des autres éléments de l’énumération Status .

Notes

Un objet CachedBitmap stocke une image dans un format optimisé pour un écran d’affichage particulier. Vous ne pouvez pas dessiner une bitmap mise en cache sur une imprimante ou un métafichier.

Les bitmaps mises en cache ne fonctionnent avec aucune transformation autre que la traduction.

Lorsque vous construisez un objet CachedBitmap , vous devez passer l’adresse d’un objet Graphics au constructeur. Si la profondeur de bits de l’écran associé à cet objet Graphics est modifiée après la construction de l’image bitmap mise en cache, la méthode Graphics::D rawCachedBitmap échoue et vous devez reconstruire l’image bitmap mise en cache. Vous pouvez également crocheter le message de notification de modification d’affichage et reconstruire l’image bitmap mise en cache à ce moment-là.

Exemples

L’exemple suivant appelle Graphics::D rawCachedBitmap pour dessiner l’image stockée dans un objet CachedBitmap .

VOID Example_DrawCachedBitmap(HDC hdc)
{
   Graphics graphics(hdc);

   // Create Bitmap object.
   Bitmap bitmap(L"Climber.jpg");

   // Use the Bitmap object to create a CachedBitmap object.
   CachedBitmap cachedBitmap(&bitmap, &graphics);

   // Draw the cached bitmap.
   graphics.DrawCachedBitmap(&cachedBitmap, 20, 10);
}

Configuration requise

   
Client minimal pris en charge Windows XP, Windows 2000 Professionnel [applications de bureau uniquement]
Serveur minimal pris en charge Windows 2000 Server [applications de bureau uniquement]
Plateforme cible Windows
En-tête gdiplusgraphics.h (inclure Gdiplus.h)
Bibliothèque Gdiplus.lib
DLL Gdiplus.dll

Voir aussi

Bitmap

Dessin, positionnement et clonage d’images

Graphismes

Utilisation d’une bitmap mise en cache pour améliorer les performances