Hello,
After inserting pictures with TRichViewEdit.InsertPicture() I wish to set the picture's size to a predifined size. For this I call:
TRichViewEdit.SetItemExtraIntProperty(ItemNo, rvepImageWidth, SIZE)
and
TRichViewEdit.SetItemExtraIntProperty(ItemNo, rvepImageHeight, SIZE)
But what is the meaning of SIZE? What unit does SIZE have?
I wish to set the picture's size in cm - e.g. 7cm x 8cm. What values have I got to pass or is there another method to define a specific image size?
Thank you for any hints!
Meaning of image size (rvepImageWidth, rvepImageHeight)?
-
- Site Admin
- Posts: 17522
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
It's an image size in pixels.
More exactly, it is in screen pixels, because when printing the image size is recalculated according to the printer resolution.
So these values are exactly the same as <img width height> in HTML.
You can convert them to inches by dividing by Screen.PixelsPerInch value.
Usually it is 96, but can be changed (for example, in Large Fonts mode, it is 120).
There is a way to make image sizes independent from the screen resolution, I can explain if you need.
More exactly, it is in screen pixels, because when printing the image size is recalculated according to the printer resolution.
So these values are exactly the same as <img width height> in HTML.
You can convert them to inches by dividing by Screen.PixelsPerInch value.
Usually it is 96, but can be changed (for example, in Large Fonts mode, it is 120).
There is a way to make image sizes independent from the screen resolution, I can explain if you need.
-
- Site Admin
- Posts: 17522
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
There is a way to use a specific resolution instead of the screen resolution.
There are two values:
1) TRVStyle.TextStyles.PixelsPerInch. By default it equals to 0 (meaning: using the screen resolution).
This value affects text displaying. For example, by setting it to 96 you will see how the document looks in the "Small Fonts" mode, to 120 - in "Large Fonts" mode.
2) The global variable RichViewPixelsPerInch : Integer = 0 (RVFuncs unit).
0 means: use the screen resolution.
This value is used when converting pixels to inches or millimeters (when printing or saving RTF files). It affects non-text items (images, tables).
I suggest you to assign both these variables to 96. After that, your documents will look the same on all computers, 1 inch = 96 pixels.
There are two values:
1) TRVStyle.TextStyles.PixelsPerInch. By default it equals to 0 (meaning: using the screen resolution).
This value affects text displaying. For example, by setting it to 96 you will see how the document looks in the "Small Fonts" mode, to 120 - in "Large Fonts" mode.
2) The global variable RichViewPixelsPerInch : Integer = 0 (RVFuncs unit).
0 means: use the screen resolution.
This value is used when converting pixels to inches or millimeters (when printing or saving RTF files). It affects non-text items (images, tables).
I suggest you to assign both these variables to 96. After that, your documents will look the same on all computers, 1 inch = 96 pixels.