TAChart: Take system colors into account in fpvectorial back-end. Update demo.

git-svn-id: trunk@31246 -
This commit is contained in:
ask 2011-06-16 11:14:10 +00:00
parent 206e4d5b90
commit 9e2e844a4f
3 changed files with 13 additions and 7 deletions

View File

@ -15,10 +15,12 @@ object Form1: TForm1
Width = 422
AxisList = <
item
Minors = <>
Title.LabelFont.Orientation = 900
end
item
Alignment = calBottom
Minors = <>
end>
Foot.Brush.Color = clBtnFace
Foot.Font.Color = clBlue

View File

@ -34,7 +34,8 @@ implementation
{$R *.lfm}
uses
FPVectorial, SVGVectorialWriter, avisocncgcodewriter, TADrawerFPVectorial;
FPVectorial, SVGVectorialWriter, avisocncgcodewriter, TADrawerFPVectorial,
TADrawUtils, TADrawerCanvas;
procedure SaveAs(AChart: TChart; AFormat: TvVectorialFormat);
const
@ -42,12 +43,15 @@ const
'pdf', 'svg', 'cdr', 'wmf', 'dxf', 'ps', 'eps', 'gcode5', 'gcode6');
var
d: TvVectorialDocument;
v: IChartDrawer;
begin
d := TvVectorialDocument.Create;
d.Width := AChart.Width;
d.Height := AChart.Height;
v := TFPVectorialDrawer.Create(d);
v.DoChartColorToFPColor := @ChartColorSysToFPColor;
with AChart do
Draw(TFPVectorialDrawer.Create(d), Rect(0, 0, Width, Height));
Draw(v, Rect(0, 0, Width, Height));
d.WriteToFile('test.' + ext[AFormat], AFormat);
end;

View File

@ -20,7 +20,7 @@ unit TADrawerFPVectorial;
interface
uses
Classes, FPCanvas, FPVectorial, TADrawUtils, fpimage;
Classes, FPCanvas, FPImage, FPVectorial, TADrawUtils;
type
@ -72,7 +72,7 @@ type
implementation
uses
Math, TAChartUtils, TAGeometry, fpvutils;
Math, TAChartUtils, TAGeometry;
{ TFPVectorialDrawer }
@ -185,7 +185,7 @@ end;
procedure TFPVectorialDrawer.PrepareSimplePen(AColor: TChartColor);
begin
FPenColor := ChartColorToFPColor(AColor);
FPenColor := FChartColorToFPColorFunc(AColor);
end;
procedure TFPVectorialDrawer.RadialPie(
@ -221,7 +221,7 @@ end;
procedure TFPVectorialDrawer.SetBrushColor(AColor: TChartColor);
begin
FBrushColor := ChartColorToFPColor(AColor);
FBrushColor := FChartColorToFPColorFunc(AColor);
end;
procedure TFPVectorialDrawer.SetBrushParams(
@ -245,7 +245,7 @@ procedure TFPVectorialDrawer.SetPenParams(
AStyle: TFPPenStyle; AColor: TChartColor);
begin
Unused(AStyle);
FPenColor := ChartColorToFPColor(AColor);
FPenColor := FChartColorToFPColorFunc(AColor);
end;
function TFPVectorialDrawer.SimpleTextExtent(const AText: String): TPoint;