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'
|
||||
)
|
||||
Title.Visible = True
|
||||
OnAfterPaint = Chart1AfterPaint
|
||||
Align = alLeft
|
||||
Color = clGreen
|
||||
ParentColor = False
|
||||
|
@ -19,6 +19,7 @@ type
|
||||
PaintBox1: TPaintBox;
|
||||
RandomChartSource1: TRandomChartSource;
|
||||
Splitter1: TSplitter;
|
||||
procedure Chart1AfterPaint(ASender: TChart);
|
||||
procedure PaintBox1Paint(Sender: TObject);
|
||||
end;
|
||||
|
||||
@ -34,10 +35,16 @@ uses
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
procedure TForm1.Chart1AfterPaint(ASender: TChart);
|
||||
begin
|
||||
PaintBox1.Invalidate;
|
||||
end;
|
||||
|
||||
procedure TForm1.PaintBox1Paint(Sender: TObject);
|
||||
var
|
||||
bmp: TBGRABitmap;
|
||||
id: IChartDrawer;
|
||||
rp: TChartRenderingParams;
|
||||
begin
|
||||
bmp := TBGRABitmap.Create(PaintBox1.Width, PaintBox1.Height);
|
||||
Chart1.DisableRedrawing;
|
||||
@ -45,7 +52,9 @@ begin
|
||||
Chart1.Title.Text.Text := 'BGRABitmap';
|
||||
id := TBGRABitmapDrawer.Create(bmp);
|
||||
id.DoGetFontOrientation := @CanvasGetFontOrientationFunc;
|
||||
rp := Chart1.RenderingParams;
|
||||
Chart1.Draw(id, Rect(0, 0, PaintBox1.Width, PaintBox1.Height));
|
||||
Chart1.RenderingParams := rp;
|
||||
bmp.Draw(PaintBox1.Canvas, 0, 0);
|
||||
Chart1.Title.Text.Text := 'Standard';
|
||||
finally
|
||||
|
Loading…
Reference in New Issue
Block a user