System.Web.HttpRequest.MapImageCoordinates C# (CSharp) Method

MapImageCoordinates() public method

public MapImageCoordinates ( string imageFieldName ) : int[]
imageFieldName string
return int[]
		public int [] MapImageCoordinates (string imageFieldName)
		{
			string method = HttpMethod;
			NameValueCollection coll = null;
			if (method == "HEAD" || method == "GET")
				coll = QueryString;
			else if (method == "POST")
				coll = Form;

			if (coll == null)
				return null;

			string x = coll [imageFieldName + ".x"];
			if (x == null || x == "")
				return null;

			string y = coll [imageFieldName + ".y"];
			if (y == null || y == "")
				return null;

			int [] result = new int [2];
			try {
				result [0] = Int32.Parse (x);
				result [1] = Int32.Parse (y);
			} catch {
				return null;
			}

			return result;
		}

Usage Example

Example #1
0
 public override int [] MapImageCoordinates(string imageFieldName)
 {
     return(w.MapImageCoordinates(imageFieldName));
 }