HRGN 與 GetDcEx 能否得到一個矩形框的 DC ?以後無論如何畫,都只有這個框中的能顯示?能不能做到?
  SetRect(r1, 10,10,300,300);
  SetRect(r2, 20,20,290,290);  HRGN1 := CreateRectRgnIndirect(R1);
  HRGN2 := CreateRectRgnIndirect(R2);
  HRGN3 := CreateRectRgnIndirect(R1);  if CombineRgn(HRGN3, HRGN1, HRGN2, RGN_XOR) = ERROR then
  begin
    OutputDebugString('CombineRgn Error!!!');
  end;  Dc := GetDCEx(Handle, HRGN3, DCX_PARENTCLIP);  bsh := CreateSolidBrush(clYellow);
  //FillRgn(Dc,HRGN3, bsh);  FillRect(Dc, R1, bsh);
  ReleaseDC(Handle, Dc);
  DeleteObject(HRGN1);
  DeleteObject(HRGN2);
  DeleteObject(HRGN3);
  DeleteObject(bsh);
我這樣做的,為什麼用 FillRect 不行,而用 FillRgn 可以。我想是 GetDcEx 錯了。