Clear Text Into BMP
-
Hello I use Drawtext() API to Write The text into the BMP Picture..... Now I want To know Is There Any API To clear That Text Into The BMP.... Please Suggest.... ///CODE TO Draw Text GetClientRect(GetDlgItem(ts.hWnd, IDC_STATIC_BMP1), &r); hdc = GetDC(GetDlgItem(ts.hWnd, IDC_STATIC_BMP1)); SetBkMode(hdc ,TRANSPARENT); SetTextColor(hdc , RGB(0,0,0)); DrawText(hdc , szTempBuffer, -1, &r , DT_SINGLELINE | DT_CENTER | DT_VCENTER);
-
Hello I use Drawtext() API to Write The text into the BMP Picture..... Now I want To know Is There Any API To clear That Text Into The BMP.... Please Suggest.... ///CODE TO Draw Text GetClientRect(GetDlgItem(ts.hWnd, IDC_STATIC_BMP1), &r); hdc = GetDC(GetDlgItem(ts.hWnd, IDC_STATIC_BMP1)); SetBkMode(hdc ,TRANSPARENT); SetTextColor(hdc , RGB(0,0,0)); DrawText(hdc , szTempBuffer, -1, &r , DT_SINGLELINE | DT_CENTER | DT_VCENTER);
Aabid wrote:
Now I want To know Is There Any API To clear That Text Into The BMP....
There is nothing like an API for this, you've got to devise logic for this purpose, probably invalidate that region where the text is printed. Or probably set the text color (Dc.SetTextColor()) to background color and then print the text again. Don't forget to test this well cause there may be cases where the edges of text are still visible. Some other options that came to my mind is to use
FillSolidRect/FillRect
with background colors, but then there will be problems when you have gradient backgrounds.Nibu babu thomas Microsoft MVP for VC++ Code must be written to be read, not by the compiler, but by another human being. Programming Blog: http://nibuthomas.wordpress.com
modified on Tuesday, August 26, 2008 6:54 AM
-
Hello I use Drawtext() API to Write The text into the BMP Picture..... Now I want To know Is There Any API To clear That Text Into The BMP.... Please Suggest.... ///CODE TO Draw Text GetClientRect(GetDlgItem(ts.hWnd, IDC_STATIC_BMP1), &r); hdc = GetDC(GetDlgItem(ts.hWnd, IDC_STATIC_BMP1)); SetBkMode(hdc ,TRANSPARENT); SetTextColor(hdc , RGB(0,0,0)); DrawText(hdc , szTempBuffer, -1, &r , DT_SINGLELINE | DT_CENTER | DT_VCENTER);