Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to display two bitmap image on window in C
    primarykey
    data
    text
    <p>i can successfully display single image on window , i'm not sure how to display two images on window. i repeated the same code for difference image but its not working. here is a code to display single image.</p> <pre><code> static HBITMAP bmpSource = NULL; static HDC hdcSource = NULL; PAINTSTRUCT ps; HDC hdcDestination; //* inside the WndProc() case WM_PAINT: bmpSource = (HBITMAP)LoadImage(NULL,file_path,IMAGE_BITMAP,0,0,LR_LOADFROMFILE); hdcSource = CreateCompatibleDC(GetDC(0)); SelectObject(hdcSource, bmpSource); hdcDestination = BeginPaint(hwnd, &amp;ps); BitBlt(hdcDestination,img_x, img_y, 300, 300, hdcSource, 0, 0, SRCCOPY); EndPaint(hwnd, &amp;ps); breaks; //** </code></pre> <p>here is what i'm doing , i have experience in window gui . </p> <pre><code> static HBITMAP bmpSource = NULL,bmpSource2 = NULL; static HDC hdcSource = NULL,hdcSource2 = NULL; PAINTSTRUCT ps; HDC hdcDestination; //* inside the WndProc() case WM_PAINT: bmpSource = (HBITMAP)LoadImage(NULL,file_path,IMAGE_BITMAP,0,0,LR_LOADFROMFILE); hdcSource = CreateCompatibleDC(GetDC(0)); SelectObject(hdcSource, bmpSource); bmpSource2 = (HBITMAP)LoadImage(NULL,file2_path,IMAGE_BITMAP,0,0,LR_LOADFROMFILE); hdcSource2 = CreateCompatibleDC(GetDC(0)); SelectObject(hdcSource2, bmpSource2); hdcDestination = BeginPaint(hwnd, &amp;ps); BitBlt(hdcDestination,img_x, img_y, 300, 300, hdcSource, 0, 0, SRCCOPY); BitBlt(hdcDestination,img2_x, img2_y, 300, 300, hdcSource2, 0, 0, SRCCOPY); EndPaint(hwnd, &amp;ps); breaks; //** </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload