반응형
function Tfrm_100.GetPanelImage(Panel:TPanel): TBitmap;
var
Ofs: Integer;
begin
if Assigned(Panel) then
begin
Result := TBitmap.Create;
try
Result.Width := Panel.ClientWidth;
Result.Height := Panel.ClientHeight;
Result.Canvas.Brush := Panel.Brush;
Result.Canvas.FillRect(Panel.ClientRect);
Result.Canvas.Lock;
try
if GetWindowLong(Panel.Handle, GWL_STYLE) and WS_BORDER <> 0 then
Ofs := -1 // Don't draw form border
else
Ofs := 0; // There is no border
Panel.PaintTo(Result.Canvas.Handle, Ofs, Ofs);
finally
Result.Canvas.Unlock;
end;
except
Result.Free;
raise;
end;
end;
end;
반응형
'Programming > Delphi' 카테고리의 다른 글
| 풍선 도움말 (0) | 2010.06.30 |
|---|---|
| COM+ 만드는 방법 (0) | 2010.06.30 |
| 작업표시줄에 프로그램 표시하기/숨기기 (0) | 2010.06.30 |
| Access violation 난 곳 찾기 (0) | 2010.06.30 |
| 웹브라우저 POST로 호출하기 (0) | 2010.06.30 |