Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

I get the error: with the error belowwith the attached code: Any help would be very much appreciated.

$
0
0

With the following code, I get the error: 'bool'; type in a using statement must be implicitly convertible to 'System.IDisposable'

private void GenerateThumbnails(double scaleFactor, Stream sourcePath, string targetPath) {
            //
            //   This sub scales an image and saves it to a folder
            //
            System.Drawing.Image image__1;
            using (image__1 == System.Drawing.Image.FromStream(sourcePath)) {
	            // can given width of image as we want
	            dynamic newWidth = Convert.ToInt32(Parser.Dbl(image__1.Width) * scaleFactor);
	            // can given height of image as we want
	            dynamic newHeight = Convert.ToInt32(Parser.Dbl(image__1.Height) * scaleFactor);
	            dynamic thumbnailImg = new Bitmap(newWidth, newHeight);
	            dynamic thumbGraph = Graphics.FromImage(thumbnailImg);
	            thumbGraph.CompositingQuality = CompositingQuality.HighQuality;
	            thumbGraph.SmoothingMode = SmoothingMode.HighQuality;
	            thumbGraph.InterpolationMode = InterpolationMode.HighQualityBicubic;
	            dynamic imageRectangle = new Rectangle(0, 0, newWidth, newHeight);
	            thumbGraph.DrawImage(image__1, imageRectangle);
	            thumbnailImg.Save(targetPath, image__1.RawFormat);
            }
        }


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>