> can someone see where I am going wrong here (the text is not being>
> rotated)...
the problem is (probably) that the original font in the bmpImage
canvas has TFont default characteristics - in particular it's
"MS Sans Serif" which is a raster font.
add in ...
typLogFont.lfFaceName :='Arial';
and your code below works fine.
ns
// Grab a copy of the font information based on the original font
information
if GetObject(bmpImage.Canvas.Font.Handle, sizeof(typLogFont),
@typLogFont) <> 0 then begin
// Change the rotation.
typLogFont.lfEscapement := 1800;
typLogFont.lfOrientation := 1800;
// Create the new font object
hndNewFont := CreateFontIndirect(typLogFont);
// Replace the handle of the old font object with the new one
bmpImage.Canvas.Font.Handle := hndNewFont;
// Write it out to the canvas
bmpImage.Canvas.TextOut(lngX, lngY, strLabel);
// Cleanup
DeleteObject(hndNewFont);
end;
Cheers
Tony Sinclair
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz