TAChart: Add BGRABitmap demo

git-svn-id: trunk@30116 -
This commit is contained in:
ask 2011-04-01 09:59:46 +00:00
parent e898288599
commit 2161f792f8
5 changed files with 258 additions and 0 deletions

4
.gitattributes vendored
View File

@ -2342,6 +2342,10 @@ components/tachart/demo/basic/demo.lpi svneol=native#text/plain
components/tachart/demo/basic/demo.lpr svneol=native#text/plain
components/tachart/demo/basic/unit1.lfm svneol=native#text/plain
components/tachart/demo/basic/unit1.pas svneol=native#text/plain
components/tachart/demo/bgra/Main.lfm svneol=native#text/plain
components/tachart/demo/bgra/Main.pas svneol=native#text/pascal
components/tachart/demo/bgra/bgrademo.lpi svneol=native#text/plain
components/tachart/demo/bgra/bgrademo.lpr svneol=native#text/pascal
components/tachart/demo/chartsource/chartsourcedemo.lpi svneol=native#text/plain
components/tachart/demo/chartsource/chartsourcedemo.lpr svneol=native#text/plain
components/tachart/demo/chartsource/main.lfm svneol=native#text/plain

View File

@ -0,0 +1,70 @@
object Form1: TForm1
Left = 1221
Height = 432
Top = 154
Width = 640
Caption = 'Form1'
ClientHeight = 432
ClientWidth = 640
Position = poScreenCenter
LCLVersion = '0.9.31'
object Chart1: TChart
Left = 0
Height = 432
Top = 0
Width = 300
AxisList = <
item
Title.LabelFont.Orientation = 900
end
item
Alignment = calBottom
end>
BackColor = clMoneyGreen
Foot.Brush.Color = clBtnFace
Foot.Font.Color = clBlue
Title.Brush.Color = clBtnFace
Title.Brush.Style = bsClear
Title.Font.Color = clBlue
Title.Font.Height = -16
Title.Text.Strings = (
'Standard'
)
Title.Visible = True
Align = alLeft
Color = clGreen
ParentColor = False
object Chart1LineSeries1: TLineSeries
LinePen.Width = 2
Source = RandomChartSource1
end
object Chart1BarSeries1: TBarSeries
BarBrush.Color = clRed
Source = RandomChartSource1
end
end
object PaintBox1: TPaintBox
Left = 304
Height = 432
Top = 0
Width = 336
Align = alClient
OnPaint = PaintBox1Paint
end
object Splitter1: TSplitter
Left = 300
Height = 432
Top = 0
Width = 4
end
object RandomChartSource1: TRandomChartSource
PointsNumber = 10
RandSeed = 1795920317
XMax = 15
XMin = 5
YMax = 10
YMin = -1
left = 189
top = 263
end
end

View File

@ -0,0 +1,57 @@
unit Main;
{$mode objfpc}{$H+}
interface
uses
Classes, ExtCtrls, PairSplitter, SysUtils, FileUtil, Forms, Controls,
Graphics, Dialogs, TAGraph, TASeries, TASources;
type
{ TForm1 }
TForm1 = class(TForm)
Chart1: TChart;
Chart1BarSeries1: TBarSeries;
Chart1LineSeries1: TLineSeries;
PaintBox1: TPaintBox;
RandomChartSource1: TRandomChartSource;
Splitter1: TSplitter;
procedure PaintBox1Paint(Sender: TObject);
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
uses
BGRABitmap, TADrawerBGRA;
{ TForm1 }
procedure TForm1.PaintBox1Paint(Sender: TObject);
var
bmp: TBGRABitmap;
begin
bmp := TBGRABitmap.Create(PaintBox1.Width, PaintBox1.Height);
Chart1.DisableRedrawing;
try
Chart1.Title.Text.Text := 'BGRABitmap';
Chart1.Draw(
TBGRABitmapDrawer.Create(bmp),
Rect(0, 0, PaintBox1.Width, PaintBox1.Height));
bmp.Draw(PaintBox1.Canvas, 0, 0);
Chart1.Title.Text.Text := 'Standard';
finally
Chart1.EnableRedrawing;
bmp.Free;
end;
end;
end.

View File

@ -0,0 +1,105 @@
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
<Version Value="9"/>
<PathDelim Value="\"/>
<General>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<ResourceType Value="res"/>
<UseXPManifest Value="True"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<StringTable ProductVersion=""/>
</VersionInfo>
<BuildModes Count="1">
<Item1 Name="Default" Default="True"/>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
<ExcludeFileFilter Value="*.(bak|ppu|o|so);*~;backup"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
</local>
</RunParams>
<RequiredPackages Count="4">
<Item1>
<PackageName Value="LCLBase"/>
<MinVersion Major="1" Release="1" Valid="True"/>
</Item1>
<Item2>
<PackageName Value="LCL"/>
</Item2>
<Item3>
<PackageName Value="bgrabitmappack"/>
</Item3>
<Item4>
<PackageName Value="TAChartLazarusPkg"/>
<MinVersion Major="1" Valid="True"/>
</Item4>
</RequiredPackages>
<Units Count="3">
<Unit0>
<Filename Value="bgrademo.lpr"/>
<IsPartOfProject Value="True"/>
<UnitName Value="bgrademo"/>
</Unit0>
<Unit1>
<Filename Value="Main.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="Form1"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="Main"/>
</Unit1>
<Unit2>
<Filename Value="..\..\tadrawerbgra.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="TADrawerBGRA"/>
</Unit2>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="bgrademo"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="..\.."/>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Linking>
<Options>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking>
<Other>
<CompilerMessages>
<UseMsgFile Value="True"/>
</CompilerMessages>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@ -0,0 +1,22 @@
program bgrademo;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset
bgrabitmappack, tachartlazaruspkg,
Forms, Main, tadrawerbgra
{ you can add units after this };
{$R *.res}
begin
RequireDerivedFormResource := True;
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.