This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
C++ CODE | |
========================================= | |
VOID Example_SetInterpColors(HDC hdc) | |
{ | |
Graphics graphics(hdc); | |
GraphicsPath path; | |
path.AddEllipse(100, -100, 600, 600); | |
PathGradientBrush pthGrBrush(&path); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Let's take an SVG sample: | |
``` | |
<?xml version="1.0" standalone="no"?> | |
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> | |
<svg width="10cm" height="10cm" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" version="1.1"> | |
<rect x=".1" y=".1" width="99.8" height="99.8" fill="none" stroke="blue" stroke-width=".2" /> | |
<!-- Start of generated content. Replaces 'use' --> | |
<g transform="translate(45, 10) scale(1.5) "> | |
<rect x="1" y="1" width="8" height="8"/> | |
<g transform="translate(15, 10) scale(1.5) "> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void draw(SkCanvas* canvas) { | |
const SkScalar scale = 256.0f; | |
const SkScalar R = 0.45f * scale; | |
const SkScalar TAU = 6.2831853f; | |
SkPath path; | |
path.moveTo(R, 0.0f); | |
for (int i = 1; i < 7; ++i) { | |
SkScalar theta = 3 * i * TAU / 7; | |
path.lineTo(R * cos(theta), R * sin(theta)); | |
} |