put a picture in a window

miconus 0 Reputation points
2023-04-22T23:50:18.0966667+00:00
i want to put from the memory a picture showing in a window. 
i have this code, but do not see it.

var
  hw:hwnd;
  windc:HDC;
  wbmp:tagBitmap;
  hbmp:HBitmap;
  dc1bmp,dc2bmp:Hdc;
  CDC:HDC;
  bpic:pointer;
begin
  hw:=createwindow;
  windc:=getdc(hw);
  bpic^:=RGB;
  wbmp.bmBits:=BPic;
  hbmp:=CreateBitmapIndirect(wbmp);
  dc1bmp:=getdc(hbmp);
  dc2bmp:=CreateCompatibleDC(dc1bmp);
  CDC:=CreateCompatibleDC(windc);
  selectobject(cdc,dc2bmp);
  bitblt(CDC,00,00,600,400,dc2bmp,0,0,SRCCOPY);
Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
10,845 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. miconus 0 Reputation points
    2023-05-17T15:57:10.1133333+00:00
    now i have this and i still do not see the pic in my window although b=True
      hbmp:=CreateBitmapIndirect(wbmp);
      CDC:=CreateCompatibleDC(windc);
      GH:=SelectObject(CDC,hbmp);
      b:=bitblt(windc,0,0,620,489,CDC,0,0,SRCCopy);
      SelectObject(CDC,GH);
      DeleteObject(CDC);
    
    
    0 comments No comments

  2. miconus 0 Reputation points
    2023-08-22T22:25:29.0366667+00:00

    there was still missed a procedure, but now i have 4 programs showing the picture in a window.

    bye!

    0 comments No comments