mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 10:59:11 +02:00
TAChart: Synchronize extents of standard and BGRA view
git-svn-id: trunk@30200 -
This commit is contained in:
parent
eda3f30176
commit
178ea522e7
@ -32,6 +32,7 @@ object Form1: TForm1
|
|||||||
'Standard'
|
'Standard'
|
||||||
)
|
)
|
||||||
Title.Visible = True
|
Title.Visible = True
|
||||||
|
OnAfterPaint = Chart1AfterPaint
|
||||||
Align = alLeft
|
Align = alLeft
|
||||||
Color = clGreen
|
Color = clGreen
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
|
@ -19,6 +19,7 @@ type
|
|||||||
PaintBox1: TPaintBox;
|
PaintBox1: TPaintBox;
|
||||||
RandomChartSource1: TRandomChartSource;
|
RandomChartSource1: TRandomChartSource;
|
||||||
Splitter1: TSplitter;
|
Splitter1: TSplitter;
|
||||||
|
procedure Chart1AfterPaint(ASender: TChart);
|
||||||
procedure PaintBox1Paint(Sender: TObject);
|
procedure PaintBox1Paint(Sender: TObject);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -34,10 +35,16 @@ uses
|
|||||||
|
|
||||||
{ TForm1 }
|
{ TForm1 }
|
||||||
|
|
||||||
|
procedure TForm1.Chart1AfterPaint(ASender: TChart);
|
||||||
|
begin
|
||||||
|
PaintBox1.Invalidate;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TForm1.PaintBox1Paint(Sender: TObject);
|
procedure TForm1.PaintBox1Paint(Sender: TObject);
|
||||||
var
|
var
|
||||||
bmp: TBGRABitmap;
|
bmp: TBGRABitmap;
|
||||||
id: IChartDrawer;
|
id: IChartDrawer;
|
||||||
|
rp: TChartRenderingParams;
|
||||||
begin
|
begin
|
||||||
bmp := TBGRABitmap.Create(PaintBox1.Width, PaintBox1.Height);
|
bmp := TBGRABitmap.Create(PaintBox1.Width, PaintBox1.Height);
|
||||||
Chart1.DisableRedrawing;
|
Chart1.DisableRedrawing;
|
||||||
@ -45,7 +52,9 @@ begin
|
|||||||
Chart1.Title.Text.Text := 'BGRABitmap';
|
Chart1.Title.Text.Text := 'BGRABitmap';
|
||||||
id := TBGRABitmapDrawer.Create(bmp);
|
id := TBGRABitmapDrawer.Create(bmp);
|
||||||
id.DoGetFontOrientation := @CanvasGetFontOrientationFunc;
|
id.DoGetFontOrientation := @CanvasGetFontOrientationFunc;
|
||||||
|
rp := Chart1.RenderingParams;
|
||||||
Chart1.Draw(id, Rect(0, 0, PaintBox1.Width, PaintBox1.Height));
|
Chart1.Draw(id, Rect(0, 0, PaintBox1.Width, PaintBox1.Height));
|
||||||
|
Chart1.RenderingParams := rp;
|
||||||
bmp.Draw(PaintBox1.Canvas, 0, 0);
|
bmp.Draw(PaintBox1.Canvas, 0, 0);
|
||||||
Chart1.Title.Text.Text := 'Standard';
|
Chart1.Title.Text.Text := 'Standard';
|
||||||
finally
|
finally
|
||||||
|
Loading…
Reference in New Issue
Block a user