Closed darklight147 closed 2 years ago
My solutions was creating a mask from a context, thanks guys great library.
can you please share how you cropped it?
Here is an example code @Jefry-nolastname :
var frameMask image.Image
frameMask, _ = gg.LoadPNG("./assets/mask.png")
dc := gg.NewContext(100, 100)
dc2 := gg.NewContextForImage(frameMask)
mask := dc2.AsMask()
dc.SetMask(mask)
dc.DrawImage(YOUR_IMAGE, 0, 0)
dc.ResetClip()
// Here you should have the image cropped in the `dc` context
thankyou so much
How do i use the Crop function to crop a custom shape, instead of rectangle