We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Image loaded from a resource file

Thread ID:





41794 Mar 12,2006 12:46 AM UTC Jul 5,2006 11:52 PM UTC WinForms 4
Tags: HTMLUIControl
Neil Conway
Asked On March 12, 2006 12:46 AM UTC

Has anyone been able to load an image from a resource file into an htmlui control? I have not seen an example of this and can only figure out how to pull an image off of a windows directory. This would be useful because resource files make the entire application more portable. Any comments would be appreciated.

Nandakumar R [Syncfusion]
Replied On March 13, 2006 01:17 PM UTC

Hi Neil, Thanks for the feedback. Loading an image file from a resource in to an HTMLUI control will be a good feature to have. I will put in a feature request to enable methods to load images from stream in to the HTMLUI control to our developers. HTMLUI control supports using custom controls into the htmlui control. Please refer the sample attached. The html file contains an image tag with the ''ImageFromStream'' attribute. At run time the sample replaces a PictureBox for the image tag and renders the embedded image from the stream. Hope this helps. Thanks for your interest in EssentialHTMLUI. Regards, Nanda.


Neil Conway
Replied On March 16, 2006 01:28 AM UTC

Thank you for taking the time to create that example, Nanda. It was very informative. That will serve as a good workaround. Regards, Neil Conway

Administrator [Syncfusion]
Replied On July 4, 2006 09:50 AM UTC

Hi, in the version 3.0.1 it was possible to connect to the NoImage-event of the img-elements in the PreRenderDocument event. If the src-attribute targeted a non existing file, the NoIMage-event was fired and you could supply a stream (e.g. from a resource) and a key to make the control render the image. Unfortunately this does no longer work in 4.2. Perhaps this helps Regards rainer BTW: is it possible to reactive the behaviour from 3.0.1?

Nandakumar R [Syncfusion]
Replied On July 5, 2006 11:52 PM UTC

Hi Rainer, Thank you for your interest in Essential HTMLUI. In the version of Syncfusion Essential Studio, we can easily load an image in the HTMLUI control from stream to the IMGElementImpl object. Please refer the following code snippet. [C#] using System.IO; using Syncfusion.Windows.Forms.HTMLUI; Assembly assembly = Assembly.GetExecutingAssembly(); Stream imageStream = assembly.GetManifestResourceStream("LoadImageFromResource.image.bmp"); IMGElementImpl img = this.htmluiControl1.Document.GetElementByUserId("img") as IMGElementImpl; img.Image = Image.FromStream(imageStream) as Bitmap; //The previous line can be replaced with the following commented statement. //img.Image = Syncfusion.HTMLUI.Base.Utility.Utilities.ImageFromStream(imageStream); Please refer the attached sample that uses the above mentioned steps to load an image from the stream in the HTMLUI control. I have requested our developers to look in to the NoImage event failure. I will get back to you with the suggested fix at the earliest. Thank you for your extensive feedback. Regards, Nanda ImageFromStream.zip


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon