25 Eylül 2019 Çarşamba

CreateCompatibleBitmap metodu

Giriş
Açıklaması şöyle.
Note: When a memory device context is created, it initially has a 1-by-1 monochrome bitmap selected into it. If this memory device context is used in CreateCompatibleBitmap, the bitmap that is created is a monochrome bitmap. To create a color bitmap, use the HDC that was used to create the memory device context
Örnek
Elimizde şöyle bir kod olsun. Bu siyah beyaz çizim yapar.
HDC hdc = GetDC (Window);
HDC hdc_buffer = CreateCompatibleDC (hdc);
HBITMAP bitmap_buffer = CreateCompatibleBitmap (hdc_buffer, width, height);
Renkli çizmek için şöyle yaparız.
CreateCompatibleBitmap(hdc, width, height);//colored bitmap

Hiç yorum yok:

Yorum Gönder