trichview.com

trichview.support.examples




Re: Determine bounds of selection in pixels ?


Return to index


Author

Message

Sergey Tkachenko

Posted: 03/31/2005 13:10:48


If dots are of the same font, you can create some canvas and measure the

text width.


bmp := TBitmap.Create;

bmp.Width := 1;

bmp.Height := 1;

bmp.Canvas.Font.Assign(RVStyle1.TextStyles[StyleNo]);

Width := bmp.Canvas.TextWidth(text);

bmp.Free;


where text is a selection text (RichViewEdit1.GetSelText), StyleNo is a text

style of the selection (RichViewEdit1.CurTextStyleNo, if the selection is of

the same font)


PS: Please post questions in trichview.support group.





Powered by ABC Amber Outlook Express Converter