//聲明:
CreatePatternBrush(
Bitmap: HBITMAP {位圖句柄}
): HBRUSH; {返回畫刷句柄}
//舉例:
procedure TForm1.FormPaint(Sender: TObject);
var
Bitmap: TBitmap;
BrushHandle: HBRUSH;
begin
Bitmap := TBitmap.Create;
Bitmap.LoadFromFile('c:\temp\bg.bmp');
BrushHandle := CreatePatternBrush(Bitmap.Handle);
FillRect(Canvas.Handle, ClIEntRect, BrushHandle);
DeleteObject(BrushHandle);
end;
//效果圖: