Witam,
piszę program do wstawiania tekstu na obrazek. Korzystam z bibliotek GDI+. Mam taki kod:
graphics := TGPGraphics.Create(bit.Canvas.Handle);
FontFamily := TGPFontFamily.Create('times new roman');
Font := TGPFont.Create(FontFamily, 100, FontStyleRegular, UnitPixel);
graphics.SetSmoothingMode(SmoothingModeHighQuality);
graphics.SetInterpolationMode(InterpolationModeBilinear);
graphics.SetTextRenderingHint(TextRenderingHintAntiAlias);
SolidBrush2 := TGPSolidBrush.Create(MakeColor(255,255,255,255));
h:=0;
w:=0;
graphics.MeasureString(tekst, length(tekst), font, sizef,stringformat,sizef2,Addr(h),Addr(w));
showmessage(floattostr(sizef2.height)+' - '+floattostr(sizef2.width));
graphics.DrawString(daneZnaku.tekst, -1, Font, MakePoint(0.0, 0.0), SolidBrush2);
tekst się dodaje, ale w złej pozycji. Podałem pozycję 0,0 a tekst pojawia się w przesunięciu. Tak samo komunikat nie pokazuje prawidłowych wymiarów tekstu. Jak można to przerobić??