Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » Best implementation of text clipping?
Best implementation of text clipping? [message #3577] Fri, 02 June 2006 17:21 Go to next message
James Thomas is currently offline  James Thomas
Messages: 26
Registered: June 2006
Promising Member
I'm converting some complicated drawing code that I originally wrote with native Win32 API calls. The problem is that I made extensive use of the clipping functionality of ExtTextOut (setting ETO_CLIPPED and passing in a RECT). This was partly to avoid text overlapping other areas but also because it allowed easy text alignment within the rectangle.

I have't been able to find any calls to ExtTextOut in the Draw source code that pass anything other than 0 for the flags and NULL for the RECT structure, so I assume this functionality is not directly supported. Can someone suggest a straightforward and efficient way of doing this? Drawing the text then clipping it by drawing over it is not an option unfortunately.

Thanks in advance.
Re: Best implementation of text clipping? [message #3587 is a reply to message #3577] Sun, 04 June 2006 18:37 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
James Thomas wrote on Fri, 02 June 2006 11:21

I'm converting some complicated drawing code that I originally wrote with native Win32 API calls. The problem is that I made extensive use of the clipping functionality of ExtTextOut (setting ETO_CLIPPED and passing in a RECT). This was partly to avoid text overlapping other areas but also because it allowed easy text alignment within the rectangle.

I have't been able to find any calls to ExtTextOut in the Draw source code that pass anything other than 0 for the flags and NULL for the RECT structure, so I assume this functionality is not directly supported. Can someone suggest a straightforward and efficient way of doing this? Drawing the text then clipping it by drawing over it is not an option unfortunately.

Thanks in advance.


Draw::Clip

or

Draw::Clipoff ?

However, one unfortunate feature of text output generally is that it does not seem like you cannot get precise clipping rectangle for given text and font - sometimes some parts are simply drawn outside font/text metrics... (strange, but true).

Mirek

Previous Topic: Icon for .exe file in Windows Explorer
Next Topic: Why there is no BI_JPEG or BI_PNG in ImageWin32.cpp?
Goto Forum:
  


Current Time: Fri Mar 29 10:44:02 CET 2024

Total time taken to generate the page: 0.01357 seconds