I want to crop the photo obtained from the database, I did the following to get the image from the database
protected void Page_Load(object sender, EventArgs e)
{
MemoryStream stream = new MemoryStream();
SqlConnection connection = new SqlConnection(@"Data Source=localhost;Initial Catalog=card;User Id=sa;Password=db2admin;");
try
{
connection.Open();
SqlCommand command = new SqlCommand("select Photo from iffcar", connection);
byte[] image = (byte[])command.ExecuteScalar();
stream.Write(image, 0, image.Length);
Bitmap bitmap = new Bitmap(stream);
Response.ContentType = "image/gif";
bitmap.Save(Response.OutputStream, ImageFormat.Jpeg);
}
catch (Exception ee)
{
connection.Close();
stream.Close();
HttpContext.Current.Response.Write(ee.Message);
}
}
The resulting image is displayed inside the browser.
Now I am fixated on how to crop this image, I want to allow the user to crop the image extracted from the database and save the cropped image, which will be transferred to the Crystal report.
Is it possible? If so, as there is any tutorial or help to help me in my end.please requirement, help me figure out how to proceed with my request.
source
share