Golang image.Point type and Pt function usage example
package image
A Point is an X, Y coordinate pair. The axes increase right and down.
Golang image.Point type and Pt function usage example
package main
import (
"fmt"
"image"
)
func main() {
rect := image.Rectangle{image.Point{0, 0}, image.Point{200, 200}}
data := image.NewRGBA(rect)
bounds := data.Bounds()
fmt.Println(bounds)
var aPoint image.Point
aPoint = image.Pt(10,10)
fmt.Println("X : ", aPoint.X)
fmt.Println("Y : ", aPoint.Y)
}
Output :
(0,0)-(200,200)
X : 10
Y : 10
References :
Advertisement
Something interesting
Tutorials
+6.5k Golang : Spell checking with ispell example
+55.3k Golang : Unmarshal JSON from http response
+7.4k Golang : Word limiter example
+17.7k Golang : [json: cannot unmarshal object into Go value of type]
+19.2k Golang : Execute shell command
+41k Golang : How to check if a string contains another sub-string?
+5.3k Golang : Get FX sentiment from website example
+21.5k Golang : How to read float value from standard input ?
+11.7k Golang : Find age or leap age from date of birth example
+11.9k Golang : Determine if time variables have same calendar day
+17k Golang : Capture stdout of a child process and act according to the result
+17.9k Golang : How to make a file read only and set it to writable again?