Page 1 of 1

Insert Picture Question

Posted: Sat Sep 03, 2005 6:32 am
by Boogie
How do I get a newly inserted picture to be vertically aligned in the middle of the line. The image is 16x16.

Posted: Sat Sep 03, 2005 4:53 pm
by Sergey Tkachenko
Unfortunately, generally it's not possible, if you do not know text height.
Image can be positioned relative to the text base line, not relative to the middle of line. More options will be implemented in future, but not now.

Properties for vertical text positioning:
1) VAlign has 2 values:
- image bottom <-> text base line
- image middle <-> text base line.

2) More precise positioning can be done using item's extra integer properties: you can shift the picture up and down by the specified number of pixels or percents. See the help about TRVExtraItemProperty type.

Posted: Sun Sep 04, 2005 10:03 am
by jonjon
Sergey,

I don't know RV's internals but I can't see how it would be difficult to place an image at the middle of a line. As far as I can understand:
1- You can already position the image according to the base line, which means that you have a method to modify vertical position of an image after the computation of the whole line's base;
2- You obviously can separate one line from the other without overlaping, which means that you should be able to compute the line's height. Or do you use another method ?

Now knowing the line's height, why can't you modify the position of the image to place it at the middle of the line ?

I'm sure I'm missing something but I'm curious to know why this can't be so simple :?:

Posted: Sun Sep 04, 2005 2:09 pm
by Sergey Tkachenko
Nothing too complicated, of course.
The only problem - the positioning relative to the line bottom/middle/top must be done after the calculation of the line vertical position, while baseline-related position does not require a post processing.

Posted: Mon Sep 05, 2005 11:48 am
by Sergey Tkachenko
Update: all the information above is obsolete.

Since v1.9.16 there are new types of VAlign for images. You need rvvaAbsMiddle. No more calculations to align images to the middle!

This version is available for registered users.