Canvas输出汉字字符串,如何竖排显示
2个回答
展开全部
使用Windows API,下面是一个例子,你可参考一下
{
TFont *pfont;
TLogFont lf;
Canvas->Font->Name = "Arial";
Canvas->Font->Size = 24;
Canvas->Font->Color = clRed;
pfont = new TFont;
pfont->Assign(Canvas->Font);
::GetObject(pfont->Handle,sizeof(lf),&lf);
lf.lfEscapement = 0 ;
lf.lfOrientation = 0;
lf.lfHeight = 25;
SetNkMode(Canvas->Handle,TRANSPARENT);
for(int i= 0;i< 9;i++)
{
pfont->Handle = ::CreateFontIndirect(&lf);
Canvas->Font->Assign(pfont);
Canvs->TextOut(Width/2,Height/2,"旋转征文字体");
lf.lfEscapement +=450;
lf.lfOrientatio +=450;
}
将以上程序放到OnPaint事件里,编译以下,您就了解
{
TFont *pfont;
TLogFont lf;
Canvas->Font->Name = "Arial";
Canvas->Font->Size = 24;
Canvas->Font->Color = clRed;
pfont = new TFont;
pfont->Assign(Canvas->Font);
::GetObject(pfont->Handle,sizeof(lf),&lf);
lf.lfEscapement = 0 ;
lf.lfOrientation = 0;
lf.lfHeight = 25;
SetNkMode(Canvas->Handle,TRANSPARENT);
for(int i= 0;i< 9;i++)
{
pfont->Handle = ::CreateFontIndirect(&lf);
Canvas->Font->Assign(pfont);
Canvs->TextOut(Width/2,Height/2,"旋转征文字体");
lf.lfEscapement +=450;
lf.lfOrientatio +=450;
}
将以上程序放到OnPaint事件里,编译以下,您就了解
2019-01-01
展开全部
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询