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

Rendering Images

Thread ID:





52014 Nov 20,2006 03:48 PM UTC Nov 22,2006 04:52 PM UTC WinForms 2
Tags: HTMLUIControl
Patick Mallahan
Asked On November 20, 2006 03:48 PM UTC

I was curious where in the code it reneders the images in the HTML document. I am working with large images, sometimes as large as 500MB, and need to resize them both physicaly and by footprint so that the print spooler does not have to try to handle these large images. I have the code ready to go for resizing. My question is, where at in the code does the image rendering occur for the HTML document? I would like to intercept the image tag path and resize the image and save it in a temporary location and update the image tags src attribute to point to the new image. Any ideas?

Ramu [Syncfusion]
Replied On November 21, 2006 06:01 PM UTC

Hi Patrick,

I regret for the delay in getting back to you.

We are working on this issue.

I will get back to you after 24 hours.

Thank you for your interest in Syncfusion Essential HTMLUI.


Ramu [Syncfusion]
Replied On November 22, 2006 04:52 PM UTC

Hi Patrick,

Thank you for your patience.

The IMGElementImpl class defines properties and methods for the img tag element. Here is the C# code that sets the different image to the "src" attribute in img tag. Selecting different file name from the combobox loads the corresponding file to HTMLUI control.

BaseElement el;
IMGElementImpl img2;

//To get the img tag elements from the html file. IMGElementImpl class defines the attribute for img tag.
Hashtable htmlelements = this.htmluiControl1.Document.GetElementsByUserIdHash();
img2 = htmlelements["img"] as IMGElementImpl;

//To save the image to a file

//Inside the ComboBox SelectedItemsChanged event.
InputHTML document = new InputHTML( "sample.htm", htmluiControl1.FormatManager );
el.Attributes["src"].Value=this.comboBox1.SelectedItem.ToString ();
img2.Height=Int32.Parse (this.comboBox2.Text.ToString());
img2.Width=Int32.Parse (this.comboBox3.Text.ToString());
htmluiControl1.PrepareDocument(document, true);

Here with I have attached the sample for your reference. In this sample selecting the file name from the ComboBox loads and sets the corresponding image to src attribute. Height and width can also be set for the img tag. Image displayed in the HTMLUI control can also be saved in specific location.

Please try this and let me know if this helps.




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