Skip to content

Instantly share code, notes, and snippets.

@peteruhnak
Last active September 18, 2016 07:49
Show Gist options
  • Save peteruhnak/2427c520e9fffd75cebb10fa1ab23400 to your computer and use it in GitHub Desktop.
Save peteruhnak/2427c520e9fffd75cebb10fa1ab23400 to your computer and use it in GitHub Desktop.
"For more than 1 depth stencilling (form with alpha for example). use rule 37"
| stencil blitter output color |
color := Color orange.
stencil := Form extent: 32@32 depth: 32.
(FormCanvas on: stencil)
fillOval: (1@1 corner: 31@31)
color: (Color white alpha: 0.5)
borderWidth: 3
borderColor: (Color white alpha: 0.8).
output := Form extent: 32@32 depth: 32.
output fill: output boundingBox fillColor: color.
blitter := BitBlt toForm: output.
blitter sourceForm: stencil;
combinationRule: 37;
sourceRect: stencil boundingBox;
copyBits.
output
"thx @latsabben"
| stencil output |
stencil := Form extent: 32@32.
(FormCanvas on: stencil)
fillOval: (1@1 corner: 31@31)
color: Color transparent
borderWidth: 3
borderColor: Color black.
output := Form extent: 32@32 depth: 32.
(FormCanvas on: output)
fillColor: Color gray;
stencil: stencil
at: 0@0
color: Color orange.
output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment