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
close icon

Insert Image bug?

I ran across a bug while trying to insert an image in a diagram. Prior to inserting an image, I had copied another image to the clipboard. When I tried to insert an image to the diagram, it inserted the image in the clipboard and not the image I selected for insertion. Our application uses the Insert Image toolbar button similar to that used in the DiagramBuilder sample. You can reproduce this behavior using the DiagramBuilder sample. Open an image file (I happened to use Microsoft Paint) and copy it to the clipboard. Next, use the Insert Image toolbar item and select a different image file to insert. You will see that the image that was copied to the clipboard is inserted into the diagram. Do you have any work-arounds for this problem? Thanks in advance for your help. Chris

1 Reply

AD Administrator Syncfusion Team January 4, 2006 07:37 PM UTC

Hi Chris, Thank you for bringing this problem to our attention. A fix has been added, and the next update of Essential Diagram will include a revised version of the BitmapTool class that inserts the correct image. For now, you can workaround the issue by examining the clipboard before calling the Diagram.InsertImage() method, and if the clipboard is found to contain a Bitmap object then replacing it with a non-Image object. The following code should give you an idea, private void barItemImage_Click(object sender, System.EventArgs e) { IDataObject dataObj = Clipboard.GetDataObject(); if(dataObj != null && dataObj.GetDataPresent(typeof(System.Drawing.Bitmap))) Clipboard.SetDataObject("Dummy Value"); this.diagramComponent.InsertImage(); } Hope this helps. Regards, Prakash Surendra Syncfusion Inc.,

Loader.
Live Chat Icon For mobile
Up arrow icon