InsertImage into Diagram

Hi, I am trying to use and evaluate the Diagram tool. I need to Insert an Image when I show the Diagram on the Form. There are 2 problems that I am facing. 1. I have the following code. private void ShowImage(Image image) { System.IO.Stream str = new MemoryStream(); image.Save(str, ImageFormat.Jpeg); Tool tool = diagram1.Controller.GetTool("ImageTool"); diagram1.Controller.ActivateTool(tool); this.diagram1.InsertImage(str); } Unless and untill the user clicks on the Diagram the image is not inserted. I need to automatically show the image. something like this RoundRect r = new RoundRect(100,100,100,100); diagram1.Model.AppendChild(r); Is there anything equivalent to this for Images? 2.Irrespective of the current zoom in the diagram, I want the image to be inserted as if the zoom is 100% Can anyone help me out with this? Thanks in Advance. Nisha

1 Reply

NI Nisha July 26, 2004 11:12 AM UTC

Oooops... I got it :) BitmapNode was my answer. >Hi, >I am trying to use and evaluate the Diagram tool. >I need to Insert an Image when I show the Diagram on the Form. >There are 2 problems that I am facing. >1. I have the following code. >private void ShowImage(Image image) >{ > System.IO.Stream str = new MemoryStream(); > image.Save(str, ImageFormat.Jpeg); > Tool tool = diagram1.Controller.GetTool("ImageTool"); > diagram1.Controller.ActivateTool(tool); > this.diagram1.InsertImage(str); >} >Unless and untill the user clicks on the Diagram the image is not inserted. >I need to automatically show the image. >something like this > RoundRect r = new RoundRect(100,100,100,100); > diagram1.Model.AppendChild(r); >Is there anything equivalent to this for Images? > >2.Irrespective of the current zoom in the diagram, I want the image to be inserted as if the zoom is 100% > >Can anyone help me out with this? > >Thanks in Advance. > >Nisha >

Loader.
Up arrow icon