I try to draw a halo for text using GDI+
Here is my code:
Bitmap *bm = new Bitmap(100, 40, PixelFormat32bppRGB);
GraphicsPath *pth = new GraphicsPath();
WCHAR text[] = L"Text Halo";
RectF pnt(20,50,100,40);
pth->AddString(text,
wcslen(text),
new FontFamily(L"Verdana"),
FontStyleRegular,
40,
pnt,
StringFormat::GenericDefault());
Gdiplus::Graphics *graph = new Gdiplus::Graphics(bm);
Matrix *mx = new Matrix(1.0f/15,0,0,1.0f/15,-(1.0f/15),-(1.0f/15));
graph->SetSmoothingMode(SmoothingModeAntiAlias);
graph->GetTransform(mx);
graph->DrawPath(&Pen(Color::Yellow, 3),pth);
graph->FillPath(new SolidBrush(Color::Red),pth);
delete pth;
delete graph;
Gdiplus::Graphics *graph_fin = new Gdiplus::Graphics(backdc);
graph_fin->SetSmoothingMode(SmoothingModeAntiAlias);
graph_fin->SetInterpolationMode(InterpolationModeHighQualityBilinear);
graph_fin->DrawImage(bm,20,50,0,0,100,40,UnitPixel);
delete bm;
delete graph_fin;
But as a result there was painted black rectangle.
Where is the mistake? And what needs to be fixed?