We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I can't figure out how to scale an image. No matter which x, y parameters I feed to Scale, this method seems to be a no-op.
x, y
Scale
package main import "github.com/fogleman/gg" func main() { dc := gg.NewContext(1000, 1000) dc.DrawCircle(500, 500, 400) dc.SetRGB(0, 0, 0) dc.Fill() dc.Scale(10, 10) dc.SavePNG("out.png") }
Maybe I've forgotten to call some other method that performs actual scaling?
The text was updated successfully, but these errors were encountered:
@hirrolot Try this.
package main import ( "github.com/fogleman/gg" "github.com/nfnt/resize" ) func main() { dc := gg.NewContext(1000, 1000) dc.DrawCircle(500, 500, 400) dc.SetRGB(0, 0, 0) dc.Fill() //dc.Scale(10, 10) img := resize.Resize(10, 10, dc.Image(), resize.Lanczos2) dc = gg.NewContextForImage(img) dc.SavePNG("out.png") }
Sorry, something went wrong.
No branches or pull requests
I can't figure out how to scale an image. No matter which
x, y
parameters I feed toScale
, this method seems to be a no-op.Maybe I've forgotten to call some other method that performs actual scaling?
The text was updated successfully, but these errors were encountered: