I noticed that WinForms RichTextBox has a property ZoomFactorthat I assume is exactly what I want - unfortunately, this seems to be completely absent in the WPF variant.
Is it possible to somehow implement the same functionality (increasing / decreasing the visible text size of the entire document without actually changing the underlying RTF)?
Update: . When installing LayoutTransform in RichTextBox, it seems to work under very simple settings, this is not quite the same as installing ZoomFactor due to several things:
- First, the scrollbar also scales. It looks stupid.
- Secondly, in my application (for some reason, but not in Kaxaml - I will investigate this to find out why), the text of the bitmap image is scaled so that it simply extends the rendered text, and not vector scaling, so it is smooth. Here is an example of what I'm talking about (note the normal scrollbar):
alt text http://img822.imageshack.us/img822/298/3b7e4e04afc943ff85b2a98.png
Update 2: . I found that scaling a bitmap was caused by setting TextOptions.TextFormattingMode to Displayinstead Ideal. Setting it to ideal, we again introduce vector scaling.
However, there is still this annoying scrollbar! I mean, one option is to disable scrolling on the RichTextBox and wrap it in a ScrollViewer, but I wonder if this will get worse. I also wonder if text wrapping will work if I do this.
source
share