Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8913923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:35:07+00:00 2026-06-15T04:35:07+00:00

Basically, what I’m trying to do is get an image to represent a page

  • 0

Basically, what I’m trying to do is get an image to represent a page (for quick browsing in a XAML GridView).

I have the pages URL (and it’s HTML content), but now I’m not completely sure how to proceed. I could just use the Favicon, but I don’t think that would scale well up to the 200×200 box I’m using to display it. The other option (as far as I can think of) is to look through the HTML source and pick out the largest image.

Is there an easier/simpler way to do that in C# other than just using Regexs to find the height/width of all the image tags and then comparing them?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T04:35:08+00:00Added an answer on June 15, 2026 at 4:35 am

    There is no way to know for sure from the HTML source what size the images are. An img tag doesn’t require the height and width parameters. If they’re not specified, then the image is displayed in its actual size. If all the img tags on the page have their height and width specified, you could pick the one that has the largest values. But those are the display sizes. The actual sizes might be quite different.

    The only way to be 100% sure is to download each image and get its size.

    By the way, if you’re parsing HTML, you probably shouldn’t be doing it with regular expressions. I know it seems simple enough, but you’re almost certain to get things wrong and not handle some common cases. You’ll save yourself a lot of time and frustration by using something like the Html Agility Pack.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
Basically, I have a main page (parent page) with a link that opens up
Basically I have an IFRAME that contains a given page - I want to
Basically what I have to do, is write a Image to the database. As
Basically I am trying to restart a service from a php web page. Here
Basically I have a main screen that comes up with a background image and
Basically I need to get older version of a file in the repository without
Basically, I have a UIImageView that will loop through 8 PNGs over 0.5 seconds.
Basically I have a large set of data in excel, and I was wondering
Basically, I have a list of delivery checkboxes one for deliver to this address

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.