Looping the quality of an image

Jan 14 2005 3:38 AM
Hi there, I am looping through quality settings of a seaved jpg until it is the file size i want after it is saved it looks at the file and gets its size then does this loop I keep getting "System.ArgumentException: Invalid parameter used" I know this has somthing to do with the quality needing to be long, which it is declared as...help!!! Below is the code of the whole page. If you remove the loop starting at if (FileLen > MaxSize) it runs fine <%@ Page Language="C#" %> <%@ import namespace="System.IO" %> <%@ import Namespace="System.Drawing.Imaging" %> <%@ import Namespace="System.Drawing" %> <%@ import Namespace="System.Drawing.Drawing2D" %>
Photo: