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

How can I change resolution in a bitmap tool?

Hi,

I need to import a bitmap or image with the lowest resolution. How can I do it with bitmap tool?


Thanks


5 Replies

PP Prakash Perumal Syncfusion Team March 3, 2023 10:18 AM UTC

Hi Blanca,


Sorry for the delay in getting back to you.


We are currently validating on your requirement to adjust the resolution of the image imported through the Bitmap Tool and will provide you with an update no later than the end of the day.


Regards,

Prakash



BC Blanca Calderon March 3, 2023 10:34 AM UTC

Ok, I will waiting for it, thanks



PP Prakash Perumal Syncfusion Team March 3, 2023 11:43 AM UTC

Hi Blanca,


We have achieved your requirement to set the desired resolution for the image imported into diagram using a custom BitmapTool as shown in the code below.


public class CustomBitmapTool: BitmapTool

{

    public CustomBitmapTool(DiagramController controller) : base(controller)

    {

        this.Name = "CustomBitmapTool";

    }

 

    public override Node CreateNode(Image imgToInsert, RectangleF rectNodeBounds)

    {

        if (imgToInsert is Bitmap bitmap)

        {

            bitmap.SetResolution(72, 72);

        }

 

        return base.CreateNode(imgToInsert, rectNodeBounds);

    }

}

// To register the CustomBitmapTool
CustomBitmapTool customBitmapTool =
new CustomBitmapTool(this.diagram1.Controller);

this.diagram1.Controller.RegisterTool(customBitmapTool);

// To activate the CustomBitmapTool
this.diagram1.Controller.ActivateTool("CustomBitmapTool");



We have also attached the sample for your reference. Please let us know if you need any further assistance.


Regards,

Prakash


Attachment: BitMapToolSample_9cdaa967.zip


BC Blanca Calderon March 9, 2023 07:34 AM UTC

Thank you, it works fine.


I have a last question, how can I export a bitmap image from .edd screen? Export to my computer.


Sometimes I need to export a image that I don't have or lose, how can I do this?


Regards,


 Blanca





PP Prakash Perumal Syncfusion Team March 10, 2023 11:05 AM UTC

Hi Blanca


To export a single node as an image, kindly visit the following user guide link:

Link: How To Convert Diagram Node To Any Image | Diagram | Windows Forms | Syncfusion


In case we have misunderstood your requirements, please provide us with additional information.


Regards,

Prakash


Loader.
Live Chat Icon For mobile
Up arrow icon