I have a richedit containing lines using different fonts, styles, languages etc.

I am drawing in a gutter. I would like to start my drawing at the same y pixel position as the corresponding line.

有帮助吗?

解决方案

Send the control an em_PosFromChar message. It returns the client coordinates of the character at the given index, although the documentation doesn't say what the coordinates represent (upper left corner, baseline center, or what). You're looking for the character's baseline.

Use em_LineIndex to get a character index for a given line number, if you don't already know the index of a character you're interested in.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top