thiefmaster
Programmer
Hi. I'm trying to figure out how to antialias a font so that it looks right in comparison to the rest of my bitmap. Here's the code that I'm already using:
This code works, but the added on text "User Name" is blocky and doesn't like right in comparison to the text already there. (ex. Registered to Is there a way to easily anti-alias this font so it looks right compared to the rest of the image? The "BN Elements" is just the font name that I am using. Hopefully, everything else makes sense.
The definition for the font EzCreateFont (from Charles Petzold's book Programming Windows 5th edition) can be found at
Thanks in advance
Code:
bitm = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_BITMAP2));
GetBitmapDimensionEx(bitm, &size);
GetClientRect (hDlg, &rect);
hdc1 = BeginPaint(hDlg, &ps);
memdc = CreateCompatibleDC(hdc1);
SelectObject(memdc,bitm);
BitBlt(hdc1, 0,0, 1000, 1000,memdc,0,0,SRCCOPY);
DeleteDC(memdc);
DeleteObject(bitm);
GetClientRect (hDlg, &rect);
SetTextColor (hdc1, RGB(180,180,180));
SetBkColor(hdc1, RGB(0,0,0));
rect.right -= 10;
rect.bottom -= 10;
rect.left += 10;
rect.top += 5;
hFont = EzCreateFont (hdc1, TEXT ("BN Elements"), 100, 0, 0, FALSE);
GetObject (hFont, sizeof (LOGFONT), &lf);
SelectObject (hdc1, hFont);
DrawText(hdc1, TEXT("User Name"), -1, &rect, DT_BOTTOM);
EndPaint (hDlg, &ps);
This code works, but the added on text "User Name" is blocky and doesn't like right in comparison to the text already there. (ex. Registered to Is there a way to easily anti-alias this font so it looks right compared to the rest of the image? The "BN Elements" is just the font name that I am using. Hopefully, everything else makes sense.
The definition for the font EzCreateFont (from Charles Petzold's book Programming Windows 5th edition) can be found at
Thanks in advance