我必須首先在透明位圖上繪製字符串,然後將A繪製到目標畫布。 但是在某些情況下,角色周圍有黑色邊框。將圖像繪製爲透明位圖時字符周圍的黑色邊框
Bitmap* tempImg = new Bitmap(1000, 1000, PixelFormat32bppARGB);
Graphics tempGr(tempImg);
tempGr.Clear(Color(0, 255,255,255));
Gdiplus::SolidBrush* brush = new SolidBrush(Color(255, 255, 0, 0));
Gdiplus::FontFamily fontFamily(L"Times New Roman");
Gdiplus::Font* font = new Gdiplus::Font(&fontFamily, 19, FontStyleRegular, UnitPixel);
RectF rec(400, 400, 1000, 10000);
tempGr.DrawString(
L"Merry Chrismas",
-1,
font,
rec,
NULL,
brush
);
Graphics desGr(hdc);
desGr.Clear(Color::Gray);
desGr.DrawImage(tempImg , 0,0, 1000, 1000);
desGr上的字符繪製有一些字體大小的黑板。
我該如何避免這個問題? 非常感謝!
對黑板有點困惑 - 想知道你的意思是黑色邊框 – Elemental 2009-10-21 13:36:50
對不起,是黑色邊框。 – user25749 2009-10-22 01:31:42
我使用DrawImage縮放位圖時遇到同樣的問題。 – moogs 2010-01-12 07:40:01