468,746 Members | 1,866 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,746 developers. It's quick & easy.

Using in-memory interfaces for images in Browser Control?

Hello all,

Suppose I am using the browser control in my application to display my
own HTML code. Now, suppose I want to show images on the page that I
currently have in memory.

One way to do this is to write the image to the file system...
presumably the temp space... and then grab the IHtmlImgElement object,
and set the source to the file location. This works really well.

BUT, lets now assume that I do not have access to write to the file
system. I have the image data in a memroy buffer... how do I hand that
to the DOM or browser control, and bypass the act of having the control
use the src attribute?

Are there any callbacks that I am missing, where I can override the
default download behavior? Something where the browser control says
"Hey! I need image blahblablah!" and I say "Here! Use this buffer as
your image!"

Anything? Any ideas? Thanks,
Brian

P.S. Although it shouldnt matter, I am using C# with .NET 2.0

May 23 '06 #1
5 1862
Brian,

I don't think you 'll be able to tamper with the DOM of the document in
such a way in order to achieve the thing you want.

You could try to implement IDocHostUIHandler and TranslateUrl to point
to Isolated Storage (where I think you can write ...) for a given image
URL request.

hmmm... nothing better than that.

Regards,
Tasos

May 23 '06 #2
Well, I am really looking for any solution... through the DOM or not.

I have come across the concept of "Asynchronous Pluggable Protocols".
It seems as if I can register a protocol type (ex. MyProt) and register
my handlers for the protocol to return data through a memory interface.
Then, through the DOM, I think I can set the image source (ex.
img.source = "MyProt://ImageID=3344";) and my handler will return the
proper image.

Has anyone done this in C#? I think I will need to hook into some COM
interop... but I havent looked into it enough yet.

May 23 '06 #4
Hi All,

OLECMD_Paste ?

1. Copy image to clipboard memory
2. Navigate to insertion point in document
3. run WB.Exec OLECMD_Paste
".neter" <gw*****@poczta.onet.pl> wrote in message
news:e4**********@news.onet.pl...
Asynchronous Pluggable Protocols
http://msdn.microsoft.com/workshop/n...w/overview.asp
http://www.devx.com/webdev/Article/17120

May 23 '06 #5
That is a very interesting backup plan! I already have a working
mockup of Asynchronous Pluggable Protocols to load an image, and it
works really well. If I run into any snags, I will look into that
option, though I am not sure how reliable the method will be... since I
need to make sure the cursor is placed in exactly the correct place.

Thanks,
Brian

May 24 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

28 posts views Thread by Anthony Williams | last post: by
4 posts views Thread by Marshall Mills | last post: by
14 posts views Thread by john.burton.email | last post: by
4 posts views Thread by Ashish | last post: by
3 posts views Thread by Mike L | last post: by
3 posts views Thread by INeedADip | last post: by
4 posts views Thread by TheLostLeaf | last post: by
reply views Thread by zhoujie | last post: by
xarzu
2 posts views Thread by xarzu | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.