Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Get Font Face from a non-editable window

Hi,

I've a non-editable window. What i mean by non-editable window is, i cannot right click on the window or select the text using mouse. I've few lines displayed on the window using DrawText() API and each line is in different font. I wanna get the font face of a particular line, for eg, 2nd line's font face, displayed on the window.

Can anybody help me out???
[396 byte] By [faaz] at [2007-11-11 8:36:25]
# 1 Re: Get Font Face from a non-editable window
Hi,

that's not easy, because what you have is a bitmap. What do you need it for? If it's really worth the effort you could framegrab the window and use some OCR software.
But as I understand it, you are the one writing the text in the first place. Don't you set the fonts yourself? So you could save them in a list togethether with the coordinates of where you wrote the text. Then implement a mouse - event handler like the on-click event which resolves the clicked coordinate to the saved font.

Cheers,

D
drkybelk at 2007-11-11 21:01:09 >