|
The specific approach is:
I made a window background with a bitmap on a form, and then used a function to write text somewhere on the window background,
My function is:
wf_writetext(char *szstr, hbitmap hbit)
ulong dc, memdc, holdbitmap, htextcolor, htemp
RECT rt
dc=GetDC(handle(this))
memdc=CreateCompatibleDC(dc)
holdbitmap=SelectObject(memdc,hbit)
rt.top=40
rt.left=100
rt.right=200
rt.bottom=70
SetBkMode(memdc, TRANSPARENT)
DrawText(memdc, as_str, len(as_str), rt, DT_LEFT +DT_VCENTER)
BitBlt(dc, rt.left, rt.top, rt.right -rt.left, rt.bottom -rt.top, memdc, rt.left, rt.top, SRCCOPY)
SelectObject(memdc, holdbitmap)
DeleteDC(memdc)
ReleaseDC(handle(this),dc)
When I repeatedly call this function to write numbers at rt, the text will overlap,
Is my approach correct?
Does anyone have an example to solve this problem? Thank you |
|