2
Follow the code below:
public FileContentResult Foto_Pequeno()
{
byte[] byte_image = null;
string query = "SELECT * FROM Imagem WHERE Id = '1'";
using (var connection = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString))
using (var command = new SqlCommand(query, connection))
{
connection.Open();
using (var reader = command.ExecuteReader())
{
if (reader.Read())
{
byte_image = (byte[])reader["Image"];
}
}
}
return new FileContentResult(byte_image, "image/png");
}
In the database is written as varbinary(MAX), the image size is 946x456. How do I resize the image if it is larger than 100x100. As height and width.
It is possible to resize image byte array to 100 x 100 ?
Do you have these 946x456 values as default? another question 100 x 100 will not get distorted? a crop up to the size!!!
– novic
Yes 946x456 is the default size. 100x100 is just a test. I want an example of decreasing the image size.
– Matheus Miranda
In this case Where Id = 1 has default size of 946x456, if Where Id = 2 has another size.
– Matheus Miranda