关闭

二进制生成缩略图

401人阅读 评论(0) 收藏 举报

    public System.Drawing.Image GetReducedImage(int Width, int Height, byte[] streamByte)
    {
        try
        {
            System.Drawing.Image ReducedImage;
            System.IO.MemoryStream ms = new System.IO.MemoryStream(streamByte);
            System.Drawing.Image img = System.Drawing.Image.FromStream(ms);
            System.Drawing.Image.GetThumbnailImageAbort callb = new System.Drawing.Image.GetThumbnailImageAbort(ThumbnailCallback);
            ReducedImage = img.GetThumbnailImage(Width, Height, callb, IntPtr.Zero);

            return ReducedImage;
        }
        catch
        {
            return null;
        }
    }

    public bool ThumbnailCallback()
    {
        return false;
    }

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:20035次
    • 积分:381
    • 等级:
    • 排名:千里之外
    • 原创:23篇
    • 转载:1篇
    • 译文:0篇
    • 评论:0条