スクールボックスの全面(見えていない部分を含めて)印刷する方法を教えて下さい。
画像キャブチャーでもいいです。
多分同じだと思いますが。
Delphi2008.
ここはどうでしょ?
http://mrxray.on.coocan.jp/Delphi/plSamples/368_ScreenCaptureTest.htm
アドレス先だと、具体的にはどの部分に当たるのでしょうか?
詳しくお願い致します。
やはり、無理なんですかね?
あー見えない部分もキャプチャするんでしたね・・・すみません
コードでスクロールさせながら複数キャプチャし、
最後に合体させるという方法しか思い当たりません・・・
ちなみにスクロールは、
ScrollBox1.HorzScrollBar.Position := ScrollBox1.HorzScrollBar.Position + 100;
とかでできます。
IMAGEに描画だけど
var
I,H,W: Integer;
X,Y: Integer;
WC: TWinControl;
begin
//枠
(*
W := 0;
H := 0;
for I:=0 to Form3.ComponentCount - 1 do
begin
if (Form3.Components[I]) is TWinControl then
begin
WC := TWinControl(Form3.Components[I]);
if (WC.Parent = ScrollBox1) then
begin
if ( W < WC.Left + WC.Width ) then W := WC.Left + WC.Width ;
if ( H < WC.Top + WC.Height) then H := WC.Top + WC.Height;
end;
end;
end;
Image1.Canvas.Brush.Color := Form3.Color;
Image1.Canvas.Pen.Color := clGray;
Image1.Canvas.Rectangle(0,0,W+1,H+1);
*)
for I:=0 to Form3.ComponentCount - 1 do
begin
if (Form3.Components[I]) is TWinControl then
begin
WC := TWinControl(Form3.Components[I]);
if (WC.Parent = ScrollBox1) then
begin
X := WC.Left;
Y := WC.Top;
WC.PaintTo(Image1.Canvas,X,Y);
end;
end;
end;
なるほど、解決しました。
PaintToを知らなかった、調べきれなかったのと、コンポーネントのキャプチャしか頭になかったので、Parentを判定してその上にあるコンポーネントを追加するというのは、なるほどと思いました。
無事に、印刷することが出来ました。
また、別の方も、ありがとうございました。
ツイート | ![]() |