473,395 Members | 1,647 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,395 software developers and data experts.

IHTMLDocument2, HTMLImgClass and images

Hi,

I've wrote a AxWebBrowser control to display html interfaces in my
application. This works fine, however, I would like to load images from my
application's resources instead of saving them to file then referencing that
file. For example:

in the HTML i'd have a image like this <img src="test.jpg" id="test"> and
then

mshtml.IHTMLDocument2 oIHTMLDocument2 = this.m_oHtmlBrowserControl.Document;
for(int x = 0; x < oIHTMLDocument2.images.length; x++)
{
mshtml.HTMLImgClass o =
(mshtml.HTMLImgClass)oIHTMLDocument2.images.item(x ,0);
if(o.id == "test")
{
// *********** load image from resources **********************
}
}

Has anyone done anything like this before? Can you help?

Thanks for any help

Chris
Nov 15 '05 #1
1 7678
Chris,

If you want to use the older resource mechanism, you can use the res
protocol which is an asychronous pluggable protocol that allows you to load
content from resource files. An article on MSDN titled "res Protocol" will
help, and it is located at (watch for line wrap):

http://msdn.microsoft.com/library/de...efined/res.asp

Be aware that you might have problems if the user is running IE6 SP1.

Also, if you want to use .NET resources, you can always define your own
asynchronous pluggable protocol which will read the resource and stream it
to the COM subsystem (which then turns it over to IE).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Chris Soulsby" <ch***********@sysinx.com> wrote in message
news:uf**************@TK2MSFTNGP09.phx.gbl...
Hi,

I've wrote a AxWebBrowser control to display html interfaces in my
application. This works fine, however, I would like to load images from my application's resources instead of saving them to file then referencing that file. For example:

in the HTML i'd have a image like this <img src="test.jpg" id="test"> and
then

mshtml.IHTMLDocument2 oIHTMLDocument2 = this.m_oHtmlBrowserControl.Document; for(int x = 0; x < oIHTMLDocument2.images.length; x++)
{
mshtml.HTMLImgClass o =
(mshtml.HTMLImgClass)oIHTMLDocument2.images.item(x ,0);
if(o.id == "test")
{
// *********** load image from resources **********************
}
}

Has anyone done anything like this before? Can you help?

Thanks for any help

Chris

Nov 15 '05 #2

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

Similar topics

7
by: Wayne | last post by:
I have a script that uses filesystemobject that reads files from a given path, in my case images. It is running on a server that is 2000 adv svr w/ all current patches. The script prior to some...
2
by: Adam Hulbert | last post by:
Hello there, I am quite new to .NET development so please forgive my question if it is trivial. I am trying to print a IHTMLDocument2 object in c# without spawning a dialog box, because the...
0
by: gqtang | last post by:
How to use IHTMLDocument2.createDocumentFromUrl method
1
by: Chris Soulsby | last post by:
Hi, I have a control that contains a embedded ie control. I used the following code to add a onclick event to a table element: IHTMLDocument2 oIHTMLDocument2 =...
0
by: pjsimon | last post by:
I am passing text to a WebBrowser object's Document object in the following manner: Browser1.Navigate("about:blank") While Not Browser1.ReadyState = _...
0
by: GHS | last post by:
I'm writing code to parse a specific website and decided to use MSHTML to help (instead of regular expressions). The parsing code is complete - looks very nice if I say so myself. :-) The...
4
toxicpaint
by: toxicpaint | last post by:
Hi, can anyone give me a hand. I'm currently displaying 4 random images at the top of a page. I did this using an array of 35 pictures and then writing them to page. The problem I have is that in...
0
by: michelqa | last post by:
Hi, Is there any way to display a IHTMLDocument2 object in a propertyGrid?? When trying to do something like the following the property grid is simply blank : using mshtml; //...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.