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

Function textEffect4

examples/text_effects/main.go:154–186  ·  view source on GitHub ↗

Text effect 4 - bevelled font http://www.imagemagick.org/Usage/fonts/#bevel

()

Source from the content-addressed store, hash-verified

152
153// Text effect 4 - bevelled font http://www.imagemagick.org/Usage/fonts/#bevel
154func textEffect4() {
155 imagick.Initialize()
156 defer imagick.Terminate()
157 mw := imagick.NewMagickWand()
158 defer mw.Destroy()
159 dw := imagick.NewDrawingWand()
160 defer dw.Destroy()
161 pw := imagick.NewPixelWand()
162 defer pw.Destroy()
163 // Create a 320x100 canvas
164 pw.SetColor("gray")
165 mw.NewImage(320, 100, pw)
166 // Set up a 72 point font
167 dw.SetFont("Verdana-Bold-Italic")
168 dw.SetFontSize(72)
169 // Set up a 72 point white font
170 pw.SetColor("white")
171 dw.SetFillColor(pw)
172 // Now draw the text
173 dw.Annotation(25, 65, "Magick")
174 // Draw the image on to the mw
175 mw.DrawImage(dw)
176 // the "gray" parameter must be true to get the effect shown on Anthony's page
177 mw.ShadeImage(true, 140, 60)
178 pw.SetColor("yellow")
179 dw.SetFillColor(pw)
180 cpw := imagick.NewPixelWand()
181 defer cpw.Destroy()
182 cpw.SetColor("gold")
183 mw.ColorizeImage(pw, cpw)
184 // and write it
185 mw.WriteImage("text_bevel.png")
186}
187
188// Text effect 5 and 6 - Plain text and then Barrel distortion
189func textEffect5And6() {

Callers 1

mainFunction · 0.85

Calls 13

DestroyMethod · 0.95
DestroyMethod · 0.95
DestroyMethod · 0.95
SetColorMethod · 0.95
NewImageMethod · 0.95
SetFontMethod · 0.95
SetFontSizeMethod · 0.95
SetFillColorMethod · 0.95
AnnotationMethod · 0.95
DrawImageMethod · 0.95
ShadeImageMethod · 0.95
ColorizeImageMethod · 0.95

Tested by

no test coverage detected