Thread View: borland.public.cppbuilder.nativeapi
3 messages
3 total messages
Started by Renald Yazmir
Mon, 02 Apr 2007 19:06
How to rotate the text by an angle
Author: Renald Yazmir
Date: Mon, 02 Apr 2007 19:06
Date: Mon, 02 Apr 2007 19:06
8 lines
1033 bytes
1033 bytes
Hello, I need to rotate the text by 90, 180, 270 degrees. Does anyone know how to do it by using standard windows API? Thank you Rony.
Re: How to rotate the text by an angle
Author: Richard Kavanagh
Date: Mon, 02 Apr 2007 18:52
Date: Mon, 02 Apr 2007 18:52
15 lines
1357 bytes
1357 bytes
LOGFONT RK "Renald Yazmir" <renald@partmaker.com> wrote in message news:4611462d@newsgroups.borland.com... > Hello, > > I need to rotate the text by 90, 180, 270 degrees. > Does anyone know how to do it by using standard windows API? > > > Thank you > Rony. >
Re: How to rotate the text by an angle
Author: Vladimir Stefanovic
Date: Mon, 02 Apr 2007 19:52
Date: Mon, 02 Apr 2007 19:52
45 lines
1913 bytes
1913 bytes
void __fastcall RotateText( AnsiString Text, TCanvas *Canvas, int rotation)
{
TLogFont Log;
HFONT HFnt;
//retrieve current font settings:
GetObject (Canvas->Font->Handle, sizeof(Log), &Log);
//Apply rotation of n deg.
Log.lfEscapement = rotation *10;
Log.lfOutPrecision = OUT_TT_ONLY_PRECIS;
HFnt = CreateFontIndirect (&Log);
//create a new font based upon new settings
SelectObject (Canvas->Handle, HFnt);
//sample text
TextOut (Canvas->Handle, 100, 100, &Text[1], Text.Length());
//free resources
DeleteObject ( HFnt );
}
void __fastcall TForm1::Button1Click(TObject *Sender)
{
Canvas->Font->Color = clBlue;
Canvas->Font->Size = 24;
RotateText( "Vertical", Canvas, 45);
}
--
Best Regards,
Vladimir Stefanovic
"Renald Yazmir" <renald@partmaker.com> wrote in message
news:4611462d@newsgroups.borland.com...
> Hello,
>
> I need to rotate the text by 90, 180, 270 degrees.
> Does anyone know how to do it by using standard windows API?
>
>
> Thank you
> Rony.
>
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads