Skip to content

Commit

Permalink
closes #19
Browse files Browse the repository at this point in the history
  • Loading branch information
rvillemeur committed Jan 6, 2025
1 parent ad8696f commit 1541770
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Chapters/Alexandrie/alexandrie.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ The path expresses the shape you want to draw with a virtual pen. It's then appl
to the destination using the `paint` message.

It's expressed with simple primitives:

* `moveTo:` moves to the specified location.
* `relativeMoveTo:` moves to the specified location, relative to your starting point.
* `lineTo:` adds a line to a specified location.
Expand All @@ -153,6 +154,7 @@ It's expressed with simple primitives:
You can find more methods in the class `AeCairoContext`.

#### Example.

Here is a full example which results in Fig. *linepath*.

```smalltalk
Expand Down Expand Up @@ -357,15 +359,22 @@ aContext
^ aSurface
```

#### Bitmap.
#### Bitmap and PNG file.

```smalltalk
form := AeCairoImageSurface fromForm:
PolymorphSystemSettings pharoLogoForm.
context sourceSurface: form x: 0 y: 0
```

The `stroke` and `fill` messages with use the source color specified and apply itto your path.
You can also get your surface from external files.

```smalltalk
aSurface := AeCairoImageSurface newFromPngFileAt: 'a.png' asFileReference.
aSurface inspect
```

The `stroke` and `fill` messages will use the source color specified and apply it to your path.

Figure *@colorpaint@* presents a full example with all color possibilities.

Expand Down

0 comments on commit 1541770

Please sign in to comment.