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.

High Resolution Images

Thread ID:

Created:

Updated:

Platform:

Replies:

31854 Jul 15,2005 02:33 PM Jul 26,2005 11:10 AM Windows Forms 4
loading
Tags: Diagram
Chris Santer
Asked On July 15, 2005 02:33 PM

Hi, Could you please tell me how insert high resolution images into the diagram control so that it maintains the resolution as required for high quality printing. So for example, if I had a 600dpi image that is 1200 pixels by 1200 pixels the image that is shown in the diagram control would be 2 inches by 2 inches and not 12.5 inches by 12.5 inches caused by the 96dpi. Thanks Chris

Administrator [Syncfusion]
Replied On July 21, 2005 03:04 PM

Hi Chris, Thank you for having raised this issue. We spent a good bit of time looking into the problem, and it looks like we sill have to provide an option in the Syncfusion.Windows.Forms.Diagram.BitmapNode class that will use the image resolution for determining the node size, and also retains the original resolution when rendering the image. We will do our best to implement this functionality in a future update of the product. For the time being, you can workaround the condition by creating and assigning to your BitmapNode an image that uses the correct resolution and size. The following code shows an approach that can be used, Image img = Image.FromFile(sourceFile); SizeF displaysize = new SizeF((img.Width/img.HorizontalResolution)*96, (img.Height/img.VerticalResolution)*96); MemoryStream memstream = new MemoryStream(); img.Save(memstream, System.Drawing.Imaging.ImageFormat.Bmp); Bitmap bmp = new Bitmap(memstream); memstream.Close(); img.Dispose(); BitmapNode bmpnode = new BitmapNode(bmp, new RectangleF(0,0,displaysize.Width,displaysize.Height)); InsertNodesCmd inscmd = new InsertNodesCmd(); inscmd.Nodes.Add(bmpnode); inscmd.Location = new PointF(20,20); this.diagramComponent.Controller.ExecuteCommand(inscmd); I hope this helps. Please let me know if the code requires further revision. Regards, Prakash Surendra Syncfusion Inc.,

Chris Santer
Replied On July 25, 2005 11:49 AM

Thank you, this works well. >Hi Chris, > >Thank you for having raised this issue. We spent a good bit of time looking into the problem, and it looks like we sill have to provide an option in the Syncfusion.Windows.Forms.Diagram.BitmapNode class that will use the image resolution for determining the node size, and also retains the original resolution when rendering the image. We will do our best to implement this functionality in a future update of the product. > >For the time being, you can workaround the condition by creating and assigning to your BitmapNode an image that uses the correct resolution and size. The following code shows an approach that can be used, > >Image img = Image.FromFile(sourceFile); >SizeF displaysize = new SizeF((img.Width/img.HorizontalResolution)*96, (img.Height/img.VerticalResolution)*96); >MemoryStream memstream = new MemoryStream(); >img.Save(memstream, System.Drawing.Imaging.ImageFormat.Bmp); >Bitmap bmp = new Bitmap(memstream); >memstream.Close(); >img.Dispose(); > >BitmapNode bmpnode = new BitmapNode(bmp, new RectangleF(0,0,displaysize.Width,displaysize.Height)); >InsertNodesCmd inscmd = new InsertNodesCmd(); >inscmd.Nodes.Add(bmpnode); >inscmd.Location = new PointF(20,20); > >this.diagramComponent.Controller.ExecuteCommand(inscmd); > >I hope this helps. Please let me know if the code requires further revision. > >Regards, >Prakash Surendra >Syncfusion Inc.,

Administrator [Syncfusion]
Replied On July 26, 2005 10:39 AM

Chris, We have made the necessary changes to the ImageNode related classes. Starting with the next version of the product, the BitmapTool will have a SizeToImageDPI property that you can set during initialization to size the node using the image resolution. Thank you for having brought this issue to our attention. Regards, Prakash Surendra Syncfusion Inc.,

Administrator [Syncfusion]
Replied On July 26, 2005 11:10 AM

Thats great, that will be good for me too.

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.

;