You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling crop.Circle(cropImage(myImage, myRect), -1, 0) returns a blank image.
Here is the cropImage implementation:
// cropImage takes an image and crops it to the specified rectangle.funccropImage(img image.Image, crop image.Rectangle) image.Image {
typesubImagerinterface {
SubImage(r image.Rectangle) image.Image
}
// img is an Image interface. This checks if the underlying value has a// method called SubImage. If it does, then we can use SubImage to crop the// image. The image types in the std lib do implement it.simg, ok:=img.(subImager)
if!ok {
panic("image does not support cropping")
}
returnsimg.SubImage(crop)
}
The text was updated successfully, but these errors were encountered:
Calling
crop.Circle(cropImage(myImage, myRect), -1, 0)
returns a blank image.Here is the cropImage implementation:
The text was updated successfully, but these errors were encountered: