HighTechTalks DotNet Forums  

Web Custom Control - Retrieve Images from a Multifile Assembly

ASP.net Building Controls microsoft.public.dotnet.framework.aspnet.buildingcontrols


Discuss Web Custom Control - Retrieve Images from a Multifile Assembly in the ASP.net Building Controls forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
MLibby
 
Posts: n/a

Default Web Custom Control - Retrieve Images from a Multifile Assembly - 09-04-2004 , 09:31 AM






How do I store an image and a web custom control's dll in a multifile
assembly so that the image can be retrieved and displayed while the control
is in design mode? This would allow the control to display a company logo
while in design and ensure that the logo's image file does not get deleted or
lost causing design mode problems.

I know that the possibility exists to have multifile assemblies which are
inclusive of the dll and other files. I found an example showing a web
application that retrieves text from a resource file embedded within a
multifile assembly. I can't find anything that deals with retrieving images
from a multifile assembly though.

Desired code example below:

using System;
using System.Web.UI;
using System.Web.UI.Design;
using System.Web.UI.WebControls;
using System.ComponentModel;
using System.ComponentModel.Design;

namespace CustCtrlDesigner
{
/// <summary>
/// Summary description for CustCtrl.
/// </summary>

[DesignerAttribute(typeof(CustCtrlDesigner), typeof(IDesigner))]
public class CustCtrl : System.Web.UI.WebControls.WebControl
{
protected override void Render(HtmlTextWriter output)
{
output.Write("<center><font size='30'>");
output.Write( "Rendered!");
output.Write("</font></center>");
}
}

public class CustCtrlDesigner : System.Web.UI.Design.ControlDesigner
{
public override string GetDesignTimeHtml()
{
// Retrieve multifile assembly image here ! ! ! ! !
string html="<img src=''>";
return html;
}
}
}

--
mcp, mcse, mcsd, mcad.net, mcsd.net

Reply With Quote
  #2  
Old   
AT
 
Posts: n/a

Default RE: Web Custom Control - Retrieve Images from a Multifile Assembly - 09-06-2004 , 01:08 AM






Hello,

I think the VS.NET IDE cannot display the image directly from the assembly.
It displays the HTML code like IE. The image should have an actual location
when it is displayed. I suggest you may exact the image from the asembly
file, save it in a temporarily folder and generate a link string pointing
to it. For exacting a image from a assembly, you may refer to this article:

HOW TO: Load a Bitmap or Image from a Resource by Using Visual C#
http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q324567

Hope this help,

Luke


Reply With Quote
  #3  
Old   
Antonio Bakula
 
Posts: n/a

Default Re: Web Custom Control - Retrieve Images from a Multifile Assembly - 09-08-2004 , 04:14 AM



On Sat, 4 Sep 2004 07:31:01 -0700, MLibby wrote:

Quote:
How do I store an image and a web custom control's dll in a multifile
assembly so that the image can be retrieved and displayed while the control
is in design mode? This would allow the control to display a company logo
while in design and ensure that the logo's image file does not get deleted or
lost causing design mode problems.

try TStreamImage control, it has design time support (be sure to read docs
included)

http://www.antoniob.com/projects/PStreamImage.aspx

this component is freeware

--
http://www.antoniob.com/
remove antispam XremoveX from e-mail !


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.