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. Image for the cookie policy date

Rendering Images

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?

2 Replies

RA Ramu Syncfusion Team 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.

Regards,
Ramu


RA Ramu Syncfusion Team 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.


[C#]
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
this.img2.Image.Save("img4.jpg");

//Inside the ComboBox SelectedItemsChanged event.
el=img2;
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.

Regards,
Ramu

BigImageInHtmlUI

Loader.
Live Chat Icon For mobile
Up arrow icon