471,069 Members | 1,335 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

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,

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

May 23 '06 #1
5 1916

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.


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
Asynchronous Pluggable Protocols

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.


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 leo001 | last post: by

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.