mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 06:05:58 -06:00
Painter docs
This commit is contained in:
parent
51be20d5c2
commit
4bdedd8046
3 changed files with 135 additions and 3 deletions
|
|
@ -57,12 +57,36 @@ void ImageRepeat(Painter& sw)
|
|||
.Stroke(2, Black());
|
||||
}
|
||||
|
||||
void ImageFillFlags(Painter& sw)
|
||||
{
|
||||
sw.Begin();
|
||||
for(int i = 0; i < 5; i++) {
|
||||
sw.DrawText(10, 20, get_i(i, "0", "FILL_PAD", "FILL_REPEAT", "FILL_REFLECT", "FILL_HPAD|FILL_VREFLECT"), Arial(28));
|
||||
sw.Rectangle(10, 60, 290, 200)
|
||||
.Fill(TestImg::test(), 90, 90, 200, 90, get_i(i, 0, FILL_PAD, FILL_REPEAT, FILL_REFLECT, FILL_HPAD|FILL_VREFLECT))
|
||||
.Stroke(1, Black());
|
||||
sw.Translate(300, 0);
|
||||
}
|
||||
sw.End();
|
||||
sw.Translate(0, 400);
|
||||
for(int i = 0; i < 2; i++) {
|
||||
sw.DrawText(10, 20, i ? "FILL_FAST" : "0"), Arial(28);
|
||||
sw.Rectangle(10, 60, 500, 500)
|
||||
.Fill(TestImg::test(), 10, 60, 500, 60, i ? FILL_FAST : 0);
|
||||
sw.Translate(600, 0);
|
||||
}
|
||||
}
|
||||
|
||||
INITBLOCK {
|
||||
/*
|
||||
RegisterExample("Image fill exact", ImageExact);
|
||||
RegisterExample("Image fill exact fast", ImageExactFast);
|
||||
RegisterExample("Image fill reflect", ImageReflect);
|
||||
RegisterExample("Image fill pad", ImagePad);
|
||||
RegisterExample("Image fill pad fast", ImagePadFast);
|
||||
RegisterExample("Image fill repeat", ImageRepeat);
|
||||
RegisterExample("Image fill", ImageRepeat);
|
||||
RegisterExample("Image vpad&hreflect", ImageVPadHReflect);
|
||||
*/
|
||||
RegisterExample("Image fill flags", ImageFillFlags);
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -11,13 +11,14 @@ topic "SVG support";
|
|||
ool]_[* RenderSVG]([_^Painter^ Painter][@(0.0.255) `&]_[*@3 p], [@(0.0.255) const]_[@(0.0.255) c
|
||||
har]_`*[*@3 svg], [_^Callback2^ Callback2]<[_^String^ String], [_^String^ String][@(0.0.255) `&
|
||||
]>`&_[*@3 resloader])&]
|
||||
[s1;%- &]
|
||||
[s2;:RenderSVG`(Painter`&`,const char`*`): [@(0.0.255) bool]_[* RenderSVG]([_^Painter^ Pain
|
||||
ter][@(0.0.255) `&]_[*@3 p], [@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 svg])&]
|
||||
[s3; Renders [*@3 svg ]to Painter [*@3 p]. Use [*@3 resloader] to provide
|
||||
resources like images, first String of callback is resource name
|
||||
(filename), the data is to be returned in second parameter. Return
|
||||
empty String if resource not found..&]
|
||||
[s4; &]
|
||||
[s4;%- &]
|
||||
[s1; &]
|
||||
[s2;:GetSVGDimensions`(const char`*`,Sizef`&`,Rectf`&`): [@(0.0.255) void]_[* GetSVGDimen
|
||||
sions]([@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 svg], [_^Sizef^ Sizef][@(0.0.255) `&]_[*@3 s
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue