pointstopixels

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


4 Replies

GA GA January 15, 2007 04:29 PM UTC

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



MW Melba Winshia Syncfusion Team January 16, 2007 12:38 PM UTC

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




AD Administrator Syncfusion Team January 16, 2007 12:51 PM UTC

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


MW Melba Winshia Syncfusion Team January 16, 2007 01:17 PM UTC

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

Loader.
Up arrow icon