MCPcopy
hub / github.com/gographics/imagick / useDraw

Function useDraw

examples/pixel_mod/main.go:11–32  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9}
10
11func useDraw() {
12 imagick.Initialize()
13 defer imagick.Terminate()
14
15 /* Create a wand */
16 mw := imagick.NewMagickWand()
17 defer mw.Destroy()
18 /* Read the input image */
19 mw.ReadImage("logo:")
20 fill := imagick.NewPixelWand()
21 defer fill.Destroy()
22 dw := imagick.NewDrawingWand()
23 defer dw.Destroy()
24 // Set the fill to "red" or you can do the same thing with this:
25 fill.SetColor("red")
26 dw.SetFillColor(fill)
27 // Uses the current Fill as the colour of the point at 200,100
28 dw.Point(200, 100)
29 mw.DrawImage(dw)
30 /* write it */
31 mw.WriteImage("logo_pixel_drawingwand.gif")
32}
33
34func usePixelIterator() {
35 imagick.Initialize()

Callers 1

mainFunction · 0.85

Calls 9

DestroyMethod · 0.95
ReadImageMethod · 0.95
DestroyMethod · 0.95
DestroyMethod · 0.95
SetColorMethod · 0.95
SetFillColorMethod · 0.95
PointMethod · 0.95
DrawImageMethod · 0.95
WriteImageMethod · 0.95

Tested by

no test coverage detected