daily pastebin goal
88%
SHARE
TWEET

Untitled

a guest Jan 21st, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package main
  2.  
  3. import "github.com/peterhellberg/gfx"
  4.  
  5. func main() {
  6.     m := gfx.NewImage(64, 64, gfx.ColorWhite)
  7.  
  8.     gfx.DrawBresenhamLine(m, gfx.V(10, 10), gfx.V(54, 54), gfx.ColorRed)
  9.     gfx.DrawBresenhamLine(m, gfx.V(10, 20), gfx.V(10, 54), gfx.ColorGreen)
  10.     gfx.DrawBresenhamLine(m, gfx.V(20, 10), gfx.V(54, 10), gfx.ColorBlue)
  11.  
  12.     s := gfx.NewScaledImage(m, 4)
  13.  
  14.     gfx.SavePNG("/tmp/gfx-readme-examples-bresenham-line.png", s)
  15. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top