在你的Frame里加一個public方法:此方法是把Frame的所有控件存到一個Bitmap里,然后你再把這個Bitmap傳到你的報表里,甚至存為bmp文件都行! Function TFrame1.AssigntoBitmap(aBitmap: TBitmap):Boolean; begin Result := False ; Assert(abitmap<>nil); if parent= nil then Exit ; if not (Parent is TCustomForm) then Exit ; abitmap.Width := width ; abitmap.Height := height ; abitmap.Canvas.CopyRect(abitmap.Canvas.ClipRect,(Parent as TCustomForm).Canvas,Rect(left,top,left+width,top+height)); Result := True ; end;
Function TFrame1.AssigntoBitmap(aBitmap: TBitmap):Boolean;
begin
Result := False ;
Assert(abitmap<>nil);
if parent= nil then Exit ;
if not (Parent is TCustomForm) then Exit ;
abitmap.Width := width ;
abitmap.Height := height ;
abitmap.Canvas.CopyRect(abitmap.Canvas.ClipRect,(Parent as TCustomForm).Canvas,Rect(left,top,left+width,top+height));
Result := True ;
end;
比如 frame 内容很多 有滚动条的话 看不见的部分怎么打印??
有没有好办法???谢谢!