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.
Vincent Maverick DuranoRank #238 · 10.3K reputationPosted Aug 23, 2017, 2:02 AM EDT
Pooja ChowdhuryRank #3,615 · 403 reputationPosted Aug 23, 2017, 2:05 AM EDT
Pratik Ghag104 reputationPosted Aug 23, 2017, 2:15 AM EDT
Vincent Maverick DuranoRank #238 · 10.3K reputationPosted Aug 23, 2017, 2:23 AM EDT
Pooja ChowdhuryRank #3,615 · 403 reputationPosted Aug 23, 2017, 2:45 AM EDT
{
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);
}
Pratik Ghag104 reputationPosted Aug 23, 2017, 2:52 AM EDT
GetThumbnailImagemethod in theImageclass:issacpal108 reputationPosted Aug 28, 2017, 11:19 PM EDT
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts