コード例 #1
0
ファイル: Service.cs プロジェクト: pasha369/Quiz
        public TransferedImage DownloadImage(string url)
        {
            TransferedImage imgOut = new TransferedImage();

            byte[] imgData;

            using (var ms = new MemoryStream())
            {
                Image img = Image.FromFile(url);
                img.Save(ms, System.Drawing.Imaging.ImageFormat.Gif);

                imgData = ms.ToArray();
            }
            imgOut.data     = imgData;
            imgOut.Filename = url.Split(@"\".ToArray()).Last();
            return(imgOut);
        }
コード例 #2
0
ファイル: Service.cs プロジェクト: pasha369/Quiz
        public TransferedImage DownloadImage(string url)
        {
            TransferedImage imgOut = new TransferedImage();
            byte[] imgData;

            using (var ms = new MemoryStream())
            {
                Image img = Image.FromFile(url);
                img.Save(ms, System.Drawing.Imaging.ImageFormat.Gif);

                imgData = ms.ToArray();
            }
            imgOut.data = imgData;
            imgOut.Filename = url.Split(@"\".ToArray()).Last();
            return imgOut;
        }