I have some images in a image folder and the image path declared in a database a particular column of a UserInfo Table.
when i fetch the images to show it took time to show in gridview.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
issacpalPosted Aug 29, 2017, 3:19 AM
Pratik GhagPosted Aug 23, 2017, 6:52 AM
GetThumbnailImagemethod in theImageclass:Pooja ChowdhuryPosted Aug 23, 2017, 6:45 AM
{
Bitmap originalImage = new Bitmap(streamImage);
int newWidth = originalImage.Width;
int newHeight = originalImage.Height;
double aspectRatio = Convert.ToDouble(originalImage.Width) / Convert.ToDouble(originalImage.Height);
if (aspectRatio <= 1 && originalImage.Width > maxWidth)
{
newWidth = maxWidth;
newHeight = Convert.ToInt32(Math.Round(newWidth / aspectRatio));
}
else if (aspectRatio > 1 && originalImage.Height > maxHeight)
{
newHeight = maxHeight;
newWidth = Convert.ToInt32(Math.Round(newHeight * aspectRatio));
}
return new Bitmap(originalImage, newWidth, newHeight);
}
Vincent Maverick DuranoPosted Aug 23, 2017, 6:23 AM
Pratik GhagPosted Aug 23, 2017, 6:15 AM
Pooja ChowdhuryPosted Aug 23, 2017, 6:05 AM
Vincent Maverick DuranoPosted Aug 23, 2017, 6:02 AM