Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Custom control: How to render an embedded image at design-time?

Reply
Thread Tools

Custom control: How to render an embedded image at design-time?

 
 
Michael Baltic
Guest
Posts: n/a
 
      07-08-2005
Check the other forum for my latest response. Basically, web controls
shouldn't have the image embedded into the dll. As a general rule all of the
resources associated with the control should be able to be modified by the
site adminstrator.

A truly extensible control, should have the ability for the user to replace
the associated images and scripts with their own resources without
recompiling the control.
--
Direct Email: Michael.Baltic@RemoveCharactersUpTo#NCMC.Com

Staff Consultant II
Enterprise Web Services
Cardinal Solutions Group


"Justin" wrote:

> >> You render an image the same way you render one at run-time (anchor

> tag)...but the path to the image has to be valid in design-time as
> well
>
> > Yes, but I know of no way to get the project path at design-time**, and

> I do not want to bundle an image with my webcontrol DLL.
>
> My original question was how to render an image in an ASP.NET
> webcontrol from an embedded resource, which means, I infer, a stream.
> But System.Web.UI.WebControls.Image has no way of consuming a stream.
> This is my main question -- how to display an embedded image in a
> webcontrol at design-time? Do I *have* to write the embedded image to
> the filesystem, then pass that path to the Image.ImageUrl ?
>
> Thank you,
> Justin
>
>

 
Reply With Quote
 
 
 
 
Mythran
Guest
Posts: n/a
 
      07-08-2005

"Justin" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
>>> You render an image the same way you render one at run-time (anchor

> tag)...but the path to the image has to be valid in design-time as
> well
>
>> Yes, but I know of no way to get the project path at design-time**, and

> I do not want to bundle an image with my webcontrol DLL.
>
> My original question was how to render an image in an ASP.NET
> webcontrol from an embedded resource, which means, I infer, a stream.
> But System.Web.UI.WebControls.Image has no way of consuming a stream.
> This is my main question -- how to display an embedded image in a
> webcontrol at design-time? Do I *have* to write the embedded image to
> the filesystem, then pass that path to the Image.ImageUrl ?
>
> Thank you,
> Justin
>


Yes, you can embed an image without writing the image to the filesystem (in
order for the http handler to receive it). What you would do is create a
class that inherits from HttpModule to handle a specific url sent by the
client, then place the specific url as the img tag's src property. There
are examples on the net on how to stream an image. Pull the image from the
assembly manifest as a Stream using the System.Reflection namespace.
(GetAssemblyResourceManifest or something, can't remember the exact name of
the method of the Assembly class to use).

HTH!

Mythran

 
Reply With Quote
 
 
 
 
Justin
Guest
Posts: n/a
 
      07-08-2005
Yes, that helps a lot. Thank you very much.

Justin

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Render Gray Colors to PDF for Proper Printing & Embedded EMF Images sherazam Java 0 06-12-2012 07:50 AM
Accessing rails render method outside of view / Decorating render Glenn Gillen Ruby 0 11-17-2006 02:30 PM
How to render an embedded image at design-time? Justin M. Keyes ASP .Net Building Controls 4 07-08-2005 08:40 PM
Page.Render do not render complete page Lau Lei Cheong ASP .Net 1 05-15-2004 04:10 AM



Advertisments