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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Canvas->TextOut disappears.

Status
Not open for further replies.

Zoiks

Technical User
Aug 8, 2007
3
FR
Hi,

I have created a grid of lines and place an X in eaxh square on the click of a mouse button. However, some of the X characters disappear when other squares are clicked and I can't see why.

Any thoughts???

Cheers....
 
Well.... off the top of my head i would have printed out the square-number and the location of the textbox with the 'X' in, it seems to be a calculating problem.

If the calculating are correct it's time to test the placing of the 'X' through a for(;;) loop with a delay for each 'X' placed, preferbly with coordinates printed out and so forth.

This should give a clear indication of where to search for the fault.

Totte
Keep making it perfect and it will end up broken.
 
Hi Totte,

I tried your suggestion, but things turned out to be the same.

I see that my problem is that some of the X characters get overwritten by my TShape. If I make the TShape smaller than the grid size, then I can see some of the X (the top and bottom corners of it.

Any suggetions on how I could stop this overwriting???

Zoiks...
 
Must it be the character 'X'?
Would 2 lines drawn to form a X do the trick?

A textbos requires more space around it than the textsize gives.

Looked ut TShape in the BCB6 help file:
"If the shape is only part of the image of a custom control, use the methods of the control’s canvas instead."

Could that be the answer?

I have done a program with statistic curves and some text to indicate certain levels and i use TextBox on the Canvas to write text at a "random" position, works like a charm.

I have howevere not tried to make it transparent so when i write over existing text it wipes out the portion that's in the way.

Totte
Keep making it perfect and it will end up broken.
 
Hi,

Good ideas to look at, thx.

Hey, I think that the problem could lie with the way that the shape moves around the box. If before I move it to its new position, I set the Visible parameter to false, then move the TShape, then set the TShape->Visible to true, then my problem disappears and the X character remains.

Very strange....

Zoiks...

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top