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.

pointstopixels

Thread ID:

Created:

Updated:

Platform:

Replies:

54692 Jan 15,2007 11:27 AM Jan 16,2007 08:17 AM Windows Forms 4
loading
Tags: XlsIO
Giancarlo Aguilera
Asked On January 15, 2007 11:27 AM

Hi!

Is there anything within xlsio that will convert pixels to points??? If not, is OK to use the measurements class located in the Diagram assembly????


Thanks

GA


GA
Replied On January 15, 2007 11:29 AM

I'm sorry, I meant to say "Is there anything within xlsio that will convert POINTS to PIXELS???

Thanks

GA

>Hi!

Is there anything within xlsio that will convert pixels to points??? If not, is OK to use the measurements class located in the Diagram assembly????


Thanks

GA


Melba Winshia [Syncfusion]
Replied On January 16, 2007 07:38 AM

Hi GA,

The height of cells is displayed in points and pixels rather than in inches. By using GetRowHeightInPixels method we can get the points (row height) in pixels. Use the following code snippets to get points in pixels.

//Set the row height in points.
sheet.Range["A1"].RowHeight=18;

//Get the row height (points) in pixels.
sheet.GetRowHeightInPixels(1);

Here is the sample for your reference:

Pointstopixel.zip

Please take a look and let me know if you have any other questions.

Best Regards,
Melba



Administrator [Syncfusion]
Replied On January 16, 2007 07:51 AM

Also there is following method in IApplication interface
float ConvertUnits( float value, MeasureUnits from, MeasureUnits to );

Melba Winshia [Syncfusion]
Replied On January 16, 2007 08:17 AM

Hi,

Yes, you can do with ConvertUnits method also. Here is the code snippet to achieve this.

//To convert points to pixel
float pixelvalue=application.ConvertUnits(18,MeasureUnits.Point,MeasureUnits.Pixel);

Here is the sample for reference:

Pointstopixel.zip

Please let me know if you have any other questions.

Thanks,
Melba

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.

;