Стартовый пул
This commit is contained in:
BIN
bgrabitmap/test/testcore/arial.glyphs
Normal file
BIN
bgrabitmap/test/testcore/arial.glyphs
Normal file
Binary file not shown.
64
bgrabitmap/test/testcore/createfont.lpi
Normal file
64
bgrabitmap/test/testcore/createfont.lpi
Normal file
@@ -0,0 +1,64 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<Version Value="12"/>
|
||||
<General>
|
||||
<Flags>
|
||||
<MainUnitHasCreateFormStatements Value="False"/>
|
||||
<MainUnitHasTitleStatement Value="False"/>
|
||||
<MainUnitHasScaledStatement Value="False"/>
|
||||
</Flags>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<Title Value="createfont"/>
|
||||
<UseAppBundle Value="False"/>
|
||||
<ResourceType Value="res"/>
|
||||
</General>
|
||||
<BuildModes>
|
||||
<Item Name="Default" Default="True"/>
|
||||
</BuildModes>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
<UseFileFilters Value="True"/>
|
||||
</PublishOptions>
|
||||
<RunParams>
|
||||
<FormatVersion Value="2"/>
|
||||
</RunParams>
|
||||
<RequiredPackages>
|
||||
<Item>
|
||||
<PackageName Value="BGRABitmapPack"/>
|
||||
</Item>
|
||||
<Item>
|
||||
<PackageName Value="LCL"/>
|
||||
</Item>
|
||||
</RequiredPackages>
|
||||
<Units>
|
||||
<Unit>
|
||||
<Filename Value="createfont.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<Target>
|
||||
<Filename Value="createfont"/>
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<UnitOutputDirectory Value="lib_createfont/$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
</CompilerOptions>
|
||||
<Debugging>
|
||||
<Exceptions>
|
||||
<Item>
|
||||
<Name Value="EAbort"/>
|
||||
</Item>
|
||||
<Item>
|
||||
<Name Value="ECodetoolError"/>
|
||||
</Item>
|
||||
<Item>
|
||||
<Name Value="EFOpenError"/>
|
||||
</Item>
|
||||
</Exceptions>
|
||||
</Debugging>
|
||||
</CONFIG>
|
16
bgrabitmap/test/testcore/createfont.lpr
Normal file
16
bgrabitmap/test/testcore/createfont.lpr
Normal file
@@ -0,0 +1,16 @@
|
||||
program createfont;
|
||||
|
||||
uses Interfaces, BGRABitmap, BGRAVectorize, SysUtils;
|
||||
|
||||
var
|
||||
f: TBGRAVectorizedFont;
|
||||
|
||||
begin
|
||||
f := TBGRAVectorizedFont.Create;
|
||||
f.Name:= 'Arial';
|
||||
f.FullHeight:= 30;
|
||||
f.NeedAsciiRange(true);
|
||||
f.SaveGlyphsToFile(ExtractFilePath(ParamStr(0))+'arial.glyphs');
|
||||
f.Free;
|
||||
end.
|
||||
|
71
bgrabitmap/test/testcore/testcore.lpi
Normal file
71
bgrabitmap/test/testcore/testcore.lpi
Normal file
@@ -0,0 +1,71 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<Version Value="12"/>
|
||||
<General>
|
||||
<Flags>
|
||||
<MainUnitHasCreateFormStatements Value="False"/>
|
||||
<MainUnitHasTitleStatement Value="False"/>
|
||||
<MainUnitHasScaledStatement Value="False"/>
|
||||
</Flags>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<Title Value="testcore"/>
|
||||
<UseAppBundle Value="False"/>
|
||||
<ResourceType Value="res"/>
|
||||
</General>
|
||||
<BuildModes>
|
||||
<Item Name="Default" Default="True"/>
|
||||
</BuildModes>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
<UseFileFilters Value="True"/>
|
||||
</PublishOptions>
|
||||
<RunParams>
|
||||
<FormatVersion Value="2"/>
|
||||
</RunParams>
|
||||
<Units>
|
||||
<Unit>
|
||||
<Filename Value="testcore.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<Target>
|
||||
<Filename Value="testcore"/>
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<OtherUnitFiles Value="../../bgrabitmap"/>
|
||||
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<CodeGeneration>
|
||||
<Optimizations>
|
||||
<OptimizationLevel Value="0"/>
|
||||
</Optimizations>
|
||||
</CodeGeneration>
|
||||
<Linking>
|
||||
<Debugging>
|
||||
<GenerateDebugInfo Value="False"/>
|
||||
<RunWithoutDebug Value="True"/>
|
||||
</Debugging>
|
||||
</Linking>
|
||||
<Other>
|
||||
<CustomOptions Value="-dBGRABITMAP_DONT_USE_LCL -dBGRABITMAP_CORE"/>
|
||||
</Other>
|
||||
</CompilerOptions>
|
||||
<Debugging>
|
||||
<Exceptions>
|
||||
<Item>
|
||||
<Name Value="EAbort"/>
|
||||
</Item>
|
||||
<Item>
|
||||
<Name Value="ECodetoolError"/>
|
||||
</Item>
|
||||
<Item>
|
||||
<Name Value="EFOpenError"/>
|
||||
</Item>
|
||||
</Exceptions>
|
||||
</Debugging>
|
||||
</CONFIG>
|
47
bgrabitmap/test/testcore/testcore.lpr
Normal file
47
bgrabitmap/test/testcore/testcore.lpr
Normal file
@@ -0,0 +1,47 @@
|
||||
program testcore;
|
||||
|
||||
uses BGRABitmap, BGRABitmapTypes, BGRACanvas, BGRACanvas2d, BGRAVectorize, SysUtils;
|
||||
|
||||
var bmp: TBGRABitmap;
|
||||
canvas: TBGRACanvas;
|
||||
canvas2d: TBGRACanvas2D;
|
||||
appDir: String;
|
||||
|
||||
begin
|
||||
appDir := ExtractFilePath(paramStr(0));
|
||||
|
||||
// create image with solid background
|
||||
bmp := TBGRABitmap.Create(400, 400, CSSSilver);
|
||||
|
||||
// draw rectangle
|
||||
canvas := TBGRACanvas.Create(bmp);
|
||||
with canvas do
|
||||
begin
|
||||
Brush.BGRAColor := CSSGreen;
|
||||
FillRect(100, 100, 300, 300);
|
||||
Free;
|
||||
end;
|
||||
|
||||
// draw text
|
||||
bmp.FontRenderer := TBGRAVectorizedFontRenderer.Create(appDir);
|
||||
bmp.FontName:= 'Arial';
|
||||
bmp.FontFullHeight:= 30;
|
||||
bmp.TextOut(0,0, 'Hello World WORLD Vamos', CSSBlack);
|
||||
|
||||
// draw a disk with shadow
|
||||
canvas2d := TBGRACanvas2D.Create(bmp);
|
||||
with canvas2d do
|
||||
begin
|
||||
shadowBlur:= 5;
|
||||
shadowOffset:= PointF(5, 5);
|
||||
shadowColor(CSSBlack);
|
||||
circle(200,200,50);
|
||||
fillStyle(CSSBlue);
|
||||
fill;
|
||||
free;
|
||||
end;
|
||||
|
||||
bmp.SaveToFile(appDir + 'square.png');
|
||||
bmp.Free;
|
||||
end.
|
||||
|
Reference in New Issue
Block a user