S
sy0116
Unregistered / Unconfirmed
GUEST, unregistred user!
我用以下代码来实现在屏幕上输出文字的功能,但文字的背景是白色的,要怎样才能使背景透明呢?<br>var<br>hScreenDC:HDC;<br>SystemTime: _SYSTEMTIME;<br>Temp: string;<br>MyOutput: PChar;<br>hfont:Cardinal;<br>begin<br>// while true do<br>begin<br>hFont:=CreateFont(170,90,0,0,8,0,0,0,DEFAULT_CHARSET,OUT_TT_PRECIS,CLIP_TT_ALWAYS,<br>PROOF_QUALITY ,DEFAULT_PITCH,'楷体');<br>hScreenDC := GetDC(0);<br>SelectObject(hScreenDC, hfont);<br>//SetBKMode(hScreenDC,TRANSPARENT);加上这一句后在XP下实现了背景透明,但在Vista下无效,在XP下编译后再拿到Vista下显示一个黑块<br>TextOut(hScreenDC, 0,0, 'sdgagfdagfdg',12);<br>ReleaseDC(0, hScreenDC);<br>DeleteObject(hFont)<br>end;<br><br>end;