From c71557f61f7a178f9fed90f6447ff29445508afc Mon Sep 17 00:00:00 2001 From: Minho Date: Wed, 10 May 2017 16:47:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=BC=E5=AE=B9png=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- graphics/copy.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/graphics/copy.go b/graphics/copy.go index 1deed8be..cbcc7cb3 100644 --- a/graphics/copy.go +++ b/graphics/copy.go @@ -15,9 +15,9 @@ func ImageCopy(src image.Image,x, y ,w, h int) (image.Image,error) { if rgbImg,ok := src.(*image.YCbCr); ok { subImg = rgbImg.SubImage(image.Rect(x, y, x+w, y+h)).(*image.YCbCr) //图片裁剪x0 y0 x1 y1 }else if rgbImg,ok := src.(*image.RGBA); ok { - subImg = rgbImg.SubImage(image.Rect(x, y, x+w, y+h)).(*image.YCbCr) //图片裁剪x0 y0 x1 y1 + subImg = rgbImg.SubImage(image.Rect(x, y, x+w, y+h)).(*image.RGBA) //图片裁剪x0 y0 x1 y1 }else if rgbImg,ok := src.(*image.NRGBA); ok { - subImg = rgbImg.SubImage(image.Rect(x, y, x+w, y+h)).(*image.YCbCr) //图片裁剪x0 y0 x1 y1 + subImg = rgbImg.SubImage(image.Rect(x, y, x+w, y+h)).(*image.NRGBA) //图片裁剪x0 y0 x1 y1 } else { return subImg,errors.New("图片解码失败")