Software Solution for Engineers and Scientist Episode 9

Tham khảo tài liệu 'software solution for engineers and scientist episode 9', kỹ thuật - công nghệ, cơ khí - chế tạo máy phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | 694 Chapter 25 HBITMAP SelectBitmap HDC HBITMAP I ---------- I 1 2 The first parameter must be the handle of a memory device context. The second parameter is the handle to the bitmap being installed. If the call succeeds the macro returns the handle to the device context object being replaced. If the call fails it returns NULL. Using the SelectBitmap macro instead of the SelectObject function produces code that is correct and the coding is made easier. Recall that programs that use the object selection macros must include the file. The handle to the bitmap used in the SelectBitmapQ macro is usually obtained with the LoadBitmapQ function previously discussed. Obtaining Bitmap Dimensions Bitmap functions often require information about the dimensions and other characteristics of the bitmap. For example the function most often used to display a bitmap is BitBlt it requires the width and height of the bitmap. If the bitmap is loaded as a resource from a file the application must obtain the bitmap dimensions before blitting it to the screen. The GetObject function is used to obtain information about a bitmap. The function s general form is as follows int GetObject HGDIOBJ hgdiobj l int cbBuffer 2 LPVOID lpvObject 3 The first parameter is the handle to a graphics object in this case the handle to a bitmap. The second parameter is the size of the buffer that holds the information returned by the call. In the case of a bitmap this parameter can be coded as sizeof BITMAP . The third parameter is a pointer to the buffer that holds the information returned by the call. In the case of a bitmap the buffer is a structure variable of type BITMAP. The BITMAP structure is defined as follows typedef struct tagBITMAP LONG bmType LONG bmWidth LONG bmHeight LONG bmWidthBytes WORD bmPlanes WORD bmBitsPixel LPVOID bmBits BITMAP Must be zero bitmap width in pixels bitmap height in pixels bytes per scan line number of color planes bits per pixel color points to bitmap .

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
170    247    5    12-06-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.