473,324 Members | 2,511 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Loading a webpage into a thumbnail

Hi all (me again. I do try to answer the posts I can instead of just
asking!!!)

Any ideas how I could load a webpage into a control that was about the size
of a stamp? I tried a few things but it just put scrollbars on the control
and showed the page as a whole. Basically, I want to scale an image of the
webpage I guess.

--
Bob Hollness

-------------------------------------
I'll have a B please Bob
Nov 21 '05 #1
11 2952
Hi Bob,

Ive never needed to do that myself (with Html) so im not entirely sure.
We know that the Explorer shell does this quickly and easily so i would be inclined to be looking
through the Win32 to leveredge whatever hooks are availbale there. No sense in reinventing the
wheel.

This article *near* where you want to go but its all in MFC/Com technologies.
http://www.codeproject.com/shell/thumbextract.asp

Beyond that there are a slew of commerical products that do this, the bulk of which seem to use
some form of print driver and then subsequently extracting an image from that.

I dont anticipate it being particularly hard but I can almost guarantee there is no
purely managed way to do this. However i would love to be proved wrong.

;)

Richard
"Bob Hollness" <bo*@blockbuster.com> wrote in message news:u8**************@TK2MSFTNGP14.phx.gbl...
Hi all (me again. I do try to answer the posts I can instead of just
asking!!!)

Any ideas how I could load a webpage into a control that was about the size
of a stamp? I tried a few things but it just put scrollbars on the control
and showed the page as a whole. Basically, I want to scale an image of the
webpage I guess.

--
Bob Hollness

-------------------------------------
I'll have a B please Bob

Nov 21 '05 #2
In fact... looks like it will be dead easy.

Using the following Win32 interface

http://msdn.microsoft.com/library/de...ailcapture.asp

Richard
Nov 21 '05 #3
Nak
Hi Bob,
Any ideas how I could load a webpage into a control that was about the
size of a stamp? I tried a few things but it just put scrollbars on the
control and showed the page as a whole. Basically, I want to scale an
image of the webpage I guess.


There are a couple of ways (as I know of). Firstly is to use MSHTML to
render the page to your desired DC. Or use IShellExtractor to get a
thumbnail of a local HTML file. Although I haven't actually managed to get
the latter to work, and something makes me believe that this feature has
been removed for security purposes, as Explorer doesn't even do it now.

Here is a link on MSHTML that *might* help you.

http://www.devcity.net/forums/topic.asp?tid=85214
^ You'll have to rummage through that one as it's full of a bunch of
people having problems doing as you desire. But I believe it should point
you in the right direction.

http://www.codeproject.com/internet/...agecapture.asp
^ This on the other hand has a working C++ example, sorry it's not .NET
:-(

Nick.
Nov 21 '05 #4
Nick,

I never understand how it was done, however now Bop Hollness write it, I get
it.
Get your page in the axwebbrowser
Take that part of screen in a bmp
Set it to a thumbnail using the tumbnail method from gdi
And that is all.

Probably not more than 20 lines of code.

I think I should try this one ones.

However I think that this is more a nice simple chalenge for our Multimedia
Student in my idea

Cor

"Nak" <a@a.com>
Any ideas how I could load a webpage into a control that was about the
size of a stamp? I tried a few things but it just put scrollbars on the
control and showed the page as a whole. Basically, I want to scale an
image of the webpage I guess.


There are a couple of ways (as I know of). Firstly is to use MSHTML to
render the page to your desired DC. Or use IShellExtractor to get a
thumbnail of a local HTML file. Although I haven't actually managed to
get the latter to work, and something makes me believe that this feature
has been removed for security purposes, as Explorer doesn't even do it
now.

Here is a link on MSHTML that *might* help you.

http://www.devcity.net/forums/topic.asp?tid=85214
^ You'll have to rummage through that one as it's full of a bunch of
people having problems doing as you desire. But I believe it should point
you in the right direction.

http://www.codeproject.com/internet/...agecapture.asp
^ This on the other hand has a working C++ example, sorry it's not .NET
:-(

Nick.

Nov 21 '05 #5
> Get your page in the axwebbrowser
Take that part of screen in a bmp
Set it to a thumbnail using the tumbnail method from gdi
And that is all.

That wouldn't work. You'd just end up with a bitmap of a section of the
webpage not a scaled image of the entire web page.
Theres no shrinkToFit method on the Webbrowser, hence Bob comments about
the scroll bars.

Richard
Nov 21 '05 #6
"Richard Myers" <fa**@address.com> wrote in message
news:ez**************@TK2MSFTNGP09.phx.gbl...
Get your page in the axwebbrowser
Take that part of screen in a bmp
Set it to a thumbnail using the tumbnail method from gdi
And that is all.

That wouldn't work. You'd just end up with a bitmap of a section of the
webpage not a scaled image of the entire web page.
Theres no shrinkToFit method on the Webbrowser, hence Bob comments about
the scroll bars.

Richard


And this was always the problem I came up against!

--

Bob

--------------------------------------
I'll have a B please Bob.
Nov 21 '05 #7
Richard

Why not, in the webbrowser is the complete "page" showed. (Not the used
browser features)

The size of that is not important that is resizable afterwards..

Cor
Nov 21 '05 #8

"Cor Ligthert" <no************@planet.nl> wrote in message
news:Or**************@TK2MSFTNGP15.phx.gbl...
Richard

Why not, in the webbrowser is the complete "page" showed. (Not the used
browser features)

The size of that is not important that is resizable afterwards..

Cor


Yeah but if the webpage is 600 pixels high and the webcontrol is only 300 *
300 you end up with a truncated image.
And scrollbars. If you resize your Firefox/IE wndow the page doesn't resize
with it. Even if the web designer has used width="100%".
Which many dont because it can make the page layout look like s**t.

<..>
Do you know how to use the Win32 API Bob?

The basic underhood methodology is to print the webpage but instead of
targeting the printer; you target memory, and then you use that to scale
your image. The actual scaling is the dead easy part,
it just getting the page into a format that you can scale in the first
place, which is not hard, if you use that Interface i
gave you a link too.

Richard


Nov 21 '05 #9
place, which is not hard, if you use that Interface i
gave you a link too.
Now ive just gazed up the thread and i couldn;t see the post to which i was
referring to here. I
didn;t mean that first link about MFC but this:
In fact... looks like it will be dead easy.
Using the following Win32 interface
http://msdn.microsoft.com/library/de...n-us/shellcc/p latform/shell/reference/ifaces/ithumbnailcapture/ithumbnailcapture.aspRichard


Which is really weird. I posted it a number of hours ago. It was in my sent
items folder but
obviously hadn't gone out.... Damn wireless connections.

Richard
Nov 21 '05 #10
Nak
Hi Richard,
Which is really weird. I posted it a number of hours ago. It was in my
sent
items folder but
obviously hadn't gone out.... Damn wireless connections.


LOL, I'd rather blame the news server or even OE, I've had these issues in
the past. Sometimes I haven't seen my post *but* I've seen ("RE: My
subject") the replies! Weirdness.

Nick.
Nov 21 '05 #11
"Richard Myers" <fa**@address.com> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl...

"Cor Ligthert" <no************@planet.nl> wrote in message
news:Or**************@TK2MSFTNGP15.phx.gbl...
Richard

Why not, in the webbrowser is the complete "page" showed. (Not the used
browser features)

The size of that is not important that is resizable afterwards..

Cor


Yeah but if the webpage is 600 pixels high and the webcontrol is only 300
*
300 you end up with a truncated image.
And scrollbars. If you resize your Firefox/IE wndow the page doesn't
resize
with it. Even if the web designer has used width="100%".
Which many dont because it can make the page layout look like s**t.

<..>
Do you know how to use the Win32 API Bob?

The basic underhood methodology is to print the webpage but instead of
targeting the printer; you target memory, and then you use that to scale
your image. The actual scaling is the dead easy part,
it just getting the page into a format that you can scale in the first
place, which is not hard, if you use that Interface i
gave you a link too.

Richard


I tried various methods of this in VB6 and it always just grabbed the part
of screen that was displayed. I did find one example of a guy who did it in
VB6 but when I tried pulling his code apart and then customising it, it
always failed. now, for the life ofe me, i cannot find this webpage again.
if i find it i'll post it.

--
Bob Hollness

-------------------------------------
I'll have a B please Bob
Nov 21 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: JS | last post by:
Dear Group, I have a webpage of small images. At the bottom is a Javascript function. If someone scrolls impatiently to the function link, when the action is complete the html does not continue...
11
by: Detlef Hüttenbach | last post by:
Whereas loading tiffs and pngs from file into an Image WebControl work, the images aren't shown when loaded from streams: In a WebForm, the image's property "ImageUrl" is set to a handler, and...
1
by: Chris Kerrison | last post by:
I have a Webpage that dynamically loads a series of thumbnail images from a SQL database into a placeholder. The problem I have is that the page displays before all the images have been populated...
27
by: Chris Tomlinson | last post by:
Hi, is there any way to specify the sequence in which images load on a web page? More specifically, here is what we need to achieve: Image1 starts loading first and the browser does not...
6
by: Ivan Bútora | last post by:
I have recently looked at http://alistapart.com/articles/imagegallery to implement a simple picture gallery on a webpage that I'm working on. Everything works fine; however, I have one question....
10
by: eholz1 | last post by:
Hello Members, I am setting up a photo website. I have decided to use PHP and MySQL. I can load jpeg files into the table (medium blob, or even longtext) and get the image(s) to display without...
3
jeremydowe
by: jeremydowe | last post by:
Hi, I have noticed that quite a few websites use a preloading graphic (i.e spining circle) to show the that the site is loading images while the user waits. How can I add this to my website? ...
9
by: Prince of Code | last post by:
How do i create a image of webpage in php? Basically what I am looking for is "Create a small image (Thumbnail) of a webpage. Let me know about your thought. Your Help is greatly appreciated !...
4
by: djlender | last post by:
Hi All! I'm hoping someone can help me with this situation. I am a developer working on a project that has a video voting page. The situation is this: The parent page has an iFrame ( named...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.