Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2005 Nov : DrawTextW

www.cryer.info
Managed Newsgroup Archive

DrawTextW

Subject:DrawTextW
Posted by:"Ian Boyd" (ian.borlandnews0..@avatopia.com)
Date:Tue, 8 Nov 2005 15:13:52 -0500

i'm trying to draw the "7/8"th character: U+215E, using DrawTextW. But
instead i get '?' rather than the wide character.

What is wrong with:

procedure TForm1.PaintBox1Paint(Sender: TObject);
const
    SevenEights = WideChar(#$215E);
var
TargetCanvas: TCanvas;
szText: WideString;
ARect: TRect;
begin
    szText := '(23'+SevenEights+' × 23'+SevenEights+')';
    TargetCanvas := PaintBox1.Canvas;
    ARect := TargetCanvas.ClipRect;
    DrawTextW(TargetCanvas.Handle, PWideChar(szText), Length(szText), ARect,
    DT_LEFT or DT_VCENTER);
end;

Glossary

Replies:

www.cryer.info
Managed Newsgroup Archive