Forum > Win32/64

graphics textrect problem.

(1/2) > >>

it shows so randomly,
i use a loop to render text using textrect.
but it give me strange behavior.
it will randomly render text like attachment in red rectangle,
the bottom line of pixel of text will render opaque.
it only happen in ASCII character

Please post the code that you use for painting this.

 workingDC is a canvas of TBitmap := ceil(workingDC.TextWidth('體') / 2); := workingDC.TextHeight('體');
      r.Top:= r.Top+ ;
      r.Bottom:= r.Bottom+;
TextStyle := workingDC.TextStyle;
TextStyle.Wordbreak := False;
workingDC.Brush.Color := AnsiColorTable[ gc ];
workingDC.font.Color := AnsiColorTable[ fc ];
workingDC.TextRect(r,r.Left,r.Top, s,TextStyle);

No, I don't want to play with pasted incomplete code snippets where I can make too many things different from you. What I need is a simple, compilable project which definitely shows the issue and which I can look at. Pack the .pas, .lfm, .lpi and .lpr files into a common .zip which you can upload via "Attachments and other options" below the forum edit box. Do not include the exe and other compiler generated files.

ok, i found the problem is when i redraw it use stretchdraw().


[0] Message Index

[#] Next page

Go to full version