Text effect 7 - Polar distortion
()
| 247 | |
| 248 | // Text effect 7 - Polar distortion |
| 249 | func textEffect7() { |
| 250 | imagick.Initialize() |
| 251 | defer imagick.Terminate() |
| 252 | // This one uses d_args[0] |
| 253 | mw := imagick.NewMagickWand() |
| 254 | defer mw.Destroy() |
| 255 | dw := imagick.NewDrawingWand() |
| 256 | defer dw.Destroy() |
| 257 | pw := imagick.NewPixelWand() |
| 258 | defer pw.Destroy() |
| 259 | // Create a 320x200 transparent canvas |
| 260 | pw.SetColor("none") |
| 261 | mw.NewImage(320, 200, pw) |
| 262 | // Set up a 72 point font |
| 263 | dw.SetFont("Verdana-Bold-Italic") |
| 264 | dw.SetFontSize(72) |
| 265 | // Now draw the text |
| 266 | dw.Annotation(25, 65, "Magick") |
| 267 | // Draw the image on to the mw |
| 268 | mw.DrawImage(dw) |
| 269 | d_args[0] = 0.0 |
| 270 | // DON'T FORGET to set the correct number of arguments here |
| 271 | mw.DistortImage(imagick.DISTORTION_POLAR, d_args, true) |
| 272 | //mw.ResetImagePage("") |
| 273 | // Trim the image again |
| 274 | mw.TrimImage(0) |
| 275 | // Add the border |
| 276 | pw.SetColor("none") |
| 277 | mw.BorderImage(pw, 10, 10) |
| 278 | // and write it |
| 279 | mw.WriteImage("text_polar.png") |
| 280 | } |
| 281 | |
| 282 | // Text effect 8 - Shepard's distortion |
| 283 | func textEffect8() { |
no test coverage detected