//hCurDC:=getdc(form1.handle); var hbmp: HBITMAP; bmi: BITMAPINFO; pvBits: Pointer; x,y: integer; begin with bmi.bmiHeader do begin biSize := sizeof(BITMAPINFOHEADER); biWidth := 100; biHeight := 100; biPlanes := 1; biBitCount := 24; // 24 pf (r,g,b) biCompression := BI_RGB; biSizeImage := 100*100*3; end; hbmp := CreateDIBSection(hCurDC, bmi, DIB_RGB_COLORS, pvBits, 0, 0); SelectObject(hCurDC, hbmp); for x := 1 to 50 do for y := 1 to 50 do PULONG(Integer(pvBits) + (x + y ) * sizeof(ULONG))^ :=$0000ff 

    2 answers 2

    The drawing itself is performed when the BitBlt function is called. See the second function call in my answer here .

      I think you mean this:

       > var bmp:Tbitmap; > begin > bmp:=Tbitmap.Create; > bmp.canvas.Handle:=getdc(0); // получаем контекст(HDC) рабочего стола > bmp.canvas.Rectangle(0,0,200,100); // А далее рисуем, как в обычном TbitMap`е =) 
      • No, I do not mean THIS, I describe the BMP and bring it to the window - ololo
      • So you want to draw in a strange window, as in a bitmap? - AseN
      • Not really. I want to display a picture in the window like this: alpha blending . - Ololo
      • Well, you plan to use this algorithm: 1) Get the window handle and its context 2) Create a bitmap and assign it the context of the received window. 3) Print the picture there. So? - AseN 5:02 pm
      • Yes. Only bitmap should look like this: f1-delphi.ru/books/delphi_tryuki_i_effekty/6_9_alfa_smeshivanie And not TBTIMAP - ololo