S
ssq237712
Unregistered / Unconfirmed
GUEST, unregistred user!
请教一下绘制2D文字的问题,下面这段从BCB翻译过来的代码有问题?
procedure glDrawString(const ss: string);
var
i, ListNum: integer;
dwChar: DWORD;
pgmf: Windows.PGlyphMetricsFloat;
h: HDC;
begin
h := wglGetCurrentDC();
for i := 1 to Length(ss) do
begin
if IsDBCSLeadByte(Ord(ss)) then
begin
dwChar := ((Ord(ss) shl 8) or Ord(ss[i + 1]));
end
else
dwChar := Ord(ss);
ListNum := glGenLists(1);
wglUseFontOutlines(h, dwChar, 1, ListNum, 0.0, 0.1,
WGL_FONT_LINES, pgmf);
glCallList(ListNum);
glDeleteLists(ListNum, 1);
end;
end;
怎么画不出来啊?是不是有什么特殊限制呢?
procedure glDrawString(const ss: string);
var
i, ListNum: integer;
dwChar: DWORD;
pgmf: Windows.PGlyphMetricsFloat;
h: HDC;
begin
h := wglGetCurrentDC();
for i := 1 to Length(ss) do
begin
if IsDBCSLeadByte(Ord(ss)) then
begin
dwChar := ((Ord(ss) shl 8) or Ord(ss[i + 1]));
end
else
dwChar := Ord(ss);
ListNum := glGenLists(1);
wglUseFontOutlines(h, dwChar, 1, ListNum, 0.0, 0.1,
WGL_FONT_LINES, pgmf);
glCallList(ListNum);
glDeleteLists(ListNum, 1);
end;
end;
怎么画不出来啊?是不是有什么特殊限制呢?