Web Custom Control - Retrieve Images from a Multifile Assembly

Discussion in 'ASP .Net Building Controls' started by MLibby, Sep 4, 2004.

  1. MLibby

    MLibby Guest

    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
    MLibby, Sep 4, 2004
    #1
    1. Advertising

  2. MLibby

    [MSFT] Guest

    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
    [MSFT], Sep 6, 2004
    #2
    1. Advertising

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

    > 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 !
    Antonio Bakula, Sep 8, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. CRON
    Replies:
    1
    Views:
    331
  2. David Isaac

    MultiFile object does not iterate

    David Isaac, Aug 10, 2005, in forum: Python
    Replies:
    1
    Views:
    247
    Fuzzyman
    Aug 10, 2005
  3. Multifile EOF error

    , Mar 20, 2006, in forum: Python
    Replies:
    2
    Views:
    319
  4. Mohsen Pahlevanzadeh

    multifile programming on python 3

    Mohsen Pahlevanzadeh, Aug 25, 2013, in forum: Python
    Replies:
    0
    Views:
    94
    Mohsen Pahlevanzadeh
    Aug 25, 2013
  5. Dave Angel

    Re: multifile programming on python 3

    Dave Angel, Aug 25, 2013, in forum: Python
    Replies:
    0
    Views:
    94
    Dave Angel
    Aug 25, 2013
Loading...

Share This Page