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.
Unfortunately, activation email could not send to your email. Please try again.

Setting Image as a background

Thread ID:

Created:

Updated:

Platform:

Replies:

27077 Apr 6,2005 04:17 AM Apr 6,2005 12:03 PM Windows Forms 1
loading
Tags: Diagram
Swati
Asked On April 6, 2005 04:17 AM

I want to know whether I can set the .jpg file as a background for DiagramWebControl. Thanks Swati

Administrator [Syncfusion]
Replied On April 6, 2005 12:03 PM

Hi Swati, Yes, it is possible to set an image as the background for the DiagramWebControl. The DiagramWebControl shares its architecture with the Windows Forms version of the product, and most of the functionality available in the Windows version of Essential Diagram is available in the Web Control as well. The following code shows how to set a background image for the Diagram Web Control, // The Web Forms Page.Load event handler private void Page_Load(object sender, System.EventArgs e) { if(this.IsPostBack == false) { // To Set a background image for the DiagramWebControl... // First create a Bitmap object for the background image string path = Server.MapPath("/syncfusion/"); path = path + @"\Web\Diagram.Web\Samples\ScriptyClient\CS\bin\suiteimage.jpg"; System.Drawing.Bitmap background = new Bitmap(path); // Now assign the image to the diagram model''s BackgroundStyle property this.DiagramWebControl1.Model.BackgroundStyle.Type = BackgroundStyle.BackgroundType.Texture; this.DiagramWebControl1.Model.BackgroundStyle.TextureWrapMode = System.Drawing.Drawing2D.WrapMode.Tile; this.DiagramWebControl1.Model.BackgroundStyle.Texture = background; } } Prakash Surendra Syncfusion Inc.,

CONFIRMATION

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.

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.

;