Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TextFlags Property of TCanvas

Status
Not open for further replies.

Dooda

IS-IT--Management
May 14, 2001
76
GB
Has any body used the TextFlags property of TCanvas? The value ETO_OPAQUE is supposed to make "the text drawn with an opaque background color. Using this flag improves performance but does not allow images behind the text rectangle to show through". So I thought turning it off would allow images behind to appear, but they are still cut by the text's rectangle. I want all the image behind to be visible except where the text characters are drawn. The canvas is a printer canvas (it's a very old program).
 
Two days on and no posts. I don't know the answer for sure, but this may lead you to a solution.

TCanvas occasionally does not do what you expect. The workaround is to use the windows API functions. Check out TextOut and SetBkMode. At one time Borland used an Win API function instead of a TCanvas one in the Grid components.

Another approach I used once was to create a temporary canvas, write to that and then copy the temp canvas to the real device (TCanvas.CopyRect).

Good luck
Simon

 
Following on from Simon's post this URL might give an indication on how to do it:


In case the URL doesn't appear properly on your display (there's an underscore in there) here it is in fixed pitch:
Code:
[URL unfurl="true"]http://delphi.about.com/cs/adptips2004/a/bltip0104_5.htm[/URL]


Andrew
Hampshire, UK
 
Thanks for your input on this, guys - I've been delayed somewhat by a system rebuild. Unless copying from a temp canvas will do it, the solution looks a bit complicated as I've not done low level stuff since pdp11, so it will take me a while to try it all out!

Thanks again

Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top