rename test_results to samples
69
Samples.md
|
@ -1,12 +1,10 @@
|
|||
### Test results
|
||||
|
||||
# Samples
|
||||
|
||||
Those samples are largely inspired by this page:
|
||||
> http://cairographics.org/samples/
|
||||
|
||||
|
||||
## Test Rectangle
|
||||
![test_results/TestRectangle.png](test_results/TestPath.png)
|
||||
|
||||
```go
|
||||
func TestRectangle() {
|
||||
|
@ -21,8 +19,9 @@ func TestRectangle() {
|
|||
}
|
||||
```
|
||||
|
||||
![samples/TestRectangle.png](samples/TestRectangle.png)
|
||||
|
||||
## Test Draw Arc
|
||||
![test_results/TestDrawArc.png](test_results/TestDrawArc.png)
|
||||
|
||||
```go
|
||||
func TestDrawArc() {
|
||||
|
@ -54,9 +53,9 @@ func TestDrawArc() {
|
|||
}
|
||||
```
|
||||
|
||||
## Test Draw Arc Negative
|
||||
![test_results/TestDrawArcNegative.png](test_results/TestDrawArcNegative.png)
|
||||
![samples/TestDrawArc.png](samples/TestDrawArc.png)
|
||||
|
||||
## Test Draw Arc Negative
|
||||
|
||||
```go
|
||||
func TestDrawArcNegative() {
|
||||
|
@ -88,8 +87,9 @@ func TestDrawArcNegative() {
|
|||
}
|
||||
```
|
||||
|
||||
![samples/TestDrawArcNegative.png](samples/TestDrawArcNegative.png)
|
||||
|
||||
## Test Curve Rectangle
|
||||
![test_results/TestCurveRectangle.png](test_results/TestCurveRectangle.png)
|
||||
|
||||
```go
|
||||
func TestCurveRectangle() {
|
||||
|
@ -148,8 +148,10 @@ func TestCurveRectangle() {
|
|||
}
|
||||
```
|
||||
|
||||
![samples/TestCurveRectangle.png](samples/TestCurveRectangle.png)
|
||||
|
||||
|
||||
## Test Draw Cubic Curve
|
||||
![test_results/TestDrawCubicCurve.png](test_results/TestDrawCubicCurve.png)
|
||||
|
||||
```go
|
||||
func TestDrawCubicCurve() {
|
||||
|
@ -177,11 +179,13 @@ func TestDrawCubicCurve() {
|
|||
gc.Stroke()
|
||||
saveToPngFile("TestDrawCubicCurve", i)
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
![samples/TestDrawCubicCurve.png](samples/TestDrawCubicCurve.png)
|
||||
|
||||
## Test Dash ##
|
||||
![test_results/TestDash.png](test_results/TestDash.png)
|
||||
|
||||
![samples/TestDash.png](samples/TestDash.png)
|
||||
|
||||
```go
|
||||
func TestDash() {
|
||||
|
@ -203,7 +207,6 @@ func TestDash() {
|
|||
```
|
||||
|
||||
## Test Fill Stroke ##
|
||||
![test_results/TestFillStroke.png](test_results/TestFillStroke.png)
|
||||
|
||||
```go
|
||||
func TestFillStroke() {
|
||||
|
@ -228,8 +231,10 @@ func TestFillStroke() {
|
|||
}
|
||||
```
|
||||
|
||||
![samples/TestFillStroke.png](samples/TestFillStroke.png)
|
||||
|
||||
|
||||
## Test Fill Style
|
||||
![test_results/TestFillStyle.png](test_results/TestFillStyle.png)
|
||||
|
||||
```go
|
||||
func TestFillStyle() {
|
||||
|
@ -262,8 +267,9 @@ func TestFillStyle() {
|
|||
}
|
||||
```
|
||||
|
||||
![samples/TestFillStyle.png](samples/TestFillStyle.png)
|
||||
|
||||
## Test Multi Segment Caps
|
||||
![test_results/TestMultiSegmentCaps.png](test_results/TestMultiSegmentCaps.png)
|
||||
|
||||
```go
|
||||
func TestMultiSegmentCaps() {
|
||||
|
@ -284,8 +290,9 @@ func TestMultiSegmentCaps() {
|
|||
}
|
||||
```
|
||||
|
||||
![samples/TestMultiSegmentCaps.png](samples/TestMultiSegmentCaps.png)
|
||||
|
||||
## Test Round Rectangle
|
||||
![test_results/TestRoundRectangle.png](test_results/TestRoundRectangle.png)
|
||||
|
||||
```go
|
||||
func TestRoundRectangle() {
|
||||
|
@ -314,8 +321,9 @@ func TestRoundRectangle() {
|
|||
}
|
||||
```
|
||||
|
||||
![samples/TestRoundRectangle.png](samples/TestRoundRectangle.png)
|
||||
|
||||
## Test Line Cap
|
||||
![test_results/TestLineCap.png](test_results/TestLineCap.png)
|
||||
|
||||
```go
|
||||
func TestLineCap() {
|
||||
|
@ -348,8 +356,9 @@ func TestLineCap() {
|
|||
}
|
||||
```
|
||||
|
||||
![samples/TestLineCap.png](samples/TestLineCap.png)
|
||||
|
||||
## Test Line Join
|
||||
![test_results/TestLineJoin.png](test_results/TestLineJoin.png)
|
||||
|
||||
```go
|
||||
func TestLineJoin() {
|
||||
|
@ -376,8 +385,9 @@ func TestLineJoin() {
|
|||
}
|
||||
```
|
||||
|
||||
![samples/TestLineJoin.png](samples/TestLineJoin.png)
|
||||
|
||||
## Test Bubble
|
||||
![test_results/TestBubble.png](test_results/TestBubble.png)
|
||||
|
||||
```go
|
||||
func TestBubble() {
|
||||
|
@ -395,8 +405,9 @@ func TestBubble() {
|
|||
}
|
||||
```
|
||||
|
||||
![samples/TestBubble.png](samples/TestBubble.png)
|
||||
|
||||
## Test Star
|
||||
![test_results/TestStar.png](test_results/TestStar.png)
|
||||
|
||||
```go
|
||||
func TestStar() {
|
||||
|
@ -415,8 +426,9 @@ func TestStar() {
|
|||
}
|
||||
```
|
||||
|
||||
![samples/TestStar.png](samples/TestStar.png)
|
||||
|
||||
## Test Transform
|
||||
![test_results/TestTransform.png](test_results/TestTransform.png)
|
||||
|
||||
```go
|
||||
func TestTransform() {
|
||||
|
@ -474,8 +486,9 @@ func TestTransform() {
|
|||
}
|
||||
```
|
||||
|
||||
![samples/TestTransform.png](samples/TestTransform.png)
|
||||
|
||||
## Test Path Transform
|
||||
![test_results/TestPathTransform.png](test_results/TestPathTransform.png)
|
||||
|
||||
```go
|
||||
func TestPathTransform() {
|
||||
|
@ -488,8 +501,9 @@ func TestPathTransform() {
|
|||
}
|
||||
```
|
||||
|
||||
![samples/TestPathTransform.png](samples/TestPathTransform.png)
|
||||
|
||||
## Test Android
|
||||
![test_results/TestAndroid.png](test_results/TestAndroid.png)
|
||||
|
||||
```go
|
||||
func android(gc *draw2d.GraphicContext, x, y float) {
|
||||
|
@ -521,8 +535,9 @@ func android(gc *draw2d.GraphicContext, x, y float) {
|
|||
}
|
||||
```
|
||||
|
||||
![samples/TestAndroid.png](samples/TestAndroid.png)
|
||||
|
||||
## Test Gopher
|
||||
![test_results/TestGopher.png](test_results/TestGopher.png)
|
||||
|
||||
```go
|
||||
func gordon(gc *draw2d.GraphicContext, x, y, w, h float) {
|
||||
|
@ -591,8 +606,9 @@ func gordon(gc *draw2d.GraphicContext, x, y, w, h float) {
|
|||
}
|
||||
```
|
||||
|
||||
![samples/TestGopher.png](samples/TestGopher.png)
|
||||
|
||||
## Test Fill String
|
||||
![test_results/TestFillString.png](test_results/TestFillString.png)
|
||||
|
||||
```go
|
||||
func TestFillString() {
|
||||
|
@ -609,3 +625,10 @@ func TestFillString() {
|
|||
saveToPngFile("TestFillString", i)
|
||||
}
|
||||
```
|
||||
|
||||
![samples/TestFillString.png](samples/TestFillString.png)
|
||||
|
||||
|
||||
## Reference
|
||||
|
||||
see corresponding [samples.go](samples/samples.go) file.
|
||||
|
|
BIN
samples/TestAndroid.png
Normal file
After Width: | Height: | Size: 4.5 KiB |
BIN
samples/TestBigPicture.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
samples/TestBubble.png
Normal file
After Width: | Height: | Size: 4.2 KiB |
BIN
samples/TestCurveRectangle.png
Normal file
After Width: | Height: | Size: 9.4 KiB |
BIN
samples/TestDash.png
Normal file
After Width: | Height: | Size: 4.7 KiB |
BIN
samples/TestDrawArc.png
Normal file
After Width: | Height: | Size: 5.2 KiB |
BIN
samples/TestDrawArcNegative.png
Normal file
After Width: | Height: | Size: 6.4 KiB |
BIN
samples/TestDrawCubicCurve.png
Normal file
After Width: | Height: | Size: 8.1 KiB |
BIN
samples/TestDrawImage.png
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
samples/TestFillString.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
samples/TestFillStroke.png
Normal file
After Width: | Height: | Size: 5.7 KiB |
BIN
samples/TestFillStyle.png
Normal file
After Width: | Height: | Size: 9.8 KiB |
BIN
samples/TestGettingStarted.png
Normal file
After Width: | Height: | Size: 603 B |
BIN
samples/TestGopher.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
samples/TestLineCap.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
samples/TestLineJoin.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
samples/TestMultiSegmentCaps.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
samples/TestPathTransform.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
samples/TestRectangle.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
samples/TestRoundRectangle.png
Normal file
After Width: | Height: | Size: 5 KiB |
BIN
samples/TestStar.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
samples/TestTransform.png
Normal file
After Width: | Height: | Size: 6.1 KiB |