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
close icon

image resize

Hi

I have a word template - i added images in and I use the following code to size them:

Dim pic6 As IWPicture = CType(IIf(TypeOf bk.InsertParagraphItem(ParagraphItemType.Picture) Is WPicture, bk.InsertParagraphItem(ParagraphItemType.Picture), Nothing), WPicture)
pic6.LoadImage(System.Drawing.Image.FromFile(dataPath2 & dr("image6")))

pic6.WidthScale = 16.83F

pic6.HeightScale = 16.83F

That works fine - but what is 'F'? I have a problem where by pictures of different resolutions display at different size. So two images 200x200pixels may display differently depending on the resolution. Is there any way to resize using mm or cm?

Thanks
Peter


1 Reply

BP Bhuvaneswari P Syncfusion Team August 20, 2008 09:25 AM UTC

Hi Peter,

Thank you for your interest in Syncfusion products

In the point specification ‘F’ represents the float value. We can set the DocIO units as only points. You have to convert from other unit to pixel. You can make use of PointsConverter.FromCm(1) class to convert the other units[cm] to points while setting the height and width of the image. Please use the Picture height and width property to set the image size.


float a=PointsConverter.FromCm(10);
picture.Height = a;
picture.Width = a;


Please let us know if you have any other questions.

Best Regards,
Bhuvana



Loader.
Live Chat Icon For mobile
Up arrow icon