hi
this is my code
protected void Page_Load(object sender, EventArgs e)
{
string imageUrl = Request.QueryString["img"];
int imageHeight = Request.QueryString["h"];
int imageWidth = Request.QueryString["w"];
if (imageUrl.IndexOf("/") >= 0 | imageUrl.IndexOf("\\") >= 0)
{
//We found a / or \
Response.End();
}
imageUrl = "mypics/" + imageUrl;
System.Drawing.Image fullSizeImg = null;
fullSizeImg = System.Drawing.Image.FromFile(Server.MapPath(imageUrl));
Response.ContentType = "image/jpg";
if (imageHeight > 0 & imageWidth > 0)
{
System.Drawing.Image.GetThumbnailImageAbort dummyCallBack = null;
dummyCallBack = new System.Drawing.Image.GetThumbnailImageAbort(ThumbnailCallback);
System.Drawing.Image thumbNailImg = null;
thumbNailImg = fullSizeImg.GetThumbnailImage(imageWidth, imageHeight, dummyCallBack, IntPtr.Zero);
fullSizeImg.Save(Response.OutputStream, ImageFormat.Gif);
}
else
{
fullSizeImg.Save(Response.OutputStream, ImageFormat.Gif);
}
}
public bool ThumbnailCallback()
{
return false;
}
when i run it this error occur
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0029: Cannot implicitly convert type 'string' to 'int'
Source Error:
|
Line 21: string imageUrl = Request.QueryString["img"];
Line 22:
Line 23: int imageHeight = Request.QueryString["h"]; Line 24: int imageWidth = Request.QueryString["w"];
Line 25:
|
i think i should convert strin to int but i dont know how i can do it
thanks