【例子介绍】delphi 手写板,触模屏保存图片
【相关图片】
【源码结构】
Result := TBitmap.Create;
try
Result.Width := aPanel.ClientWidth;
Result.Height := aPanel.ClientHeight;
Result.Canvas.Brush :=aPanel.Brush;
Result.Canvas.FillRect(aPanel.ClientRect);
Result.Canvas.Lock;
try
if GetWindowLong(aPanel.Handle, GWL_STYLE) and WS_BORDER <> 0 then
Ofs := -1 // Don't draw form border
else
Ofs := 0; // There is no border
aPanel.PaintTo(Result.Canvas.Handle, Ofs, Ofs);
finally
Result.Canvas.Unlock;
end;
except
Result.Free;
raise;
end;
评论