The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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
ADAdministrator 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.,