GDI+ 文字旋转后 位置变化.
2014-12-30 11:56
323 查看
StringFormat format;
format.SetAlignment(StringAlignmentCenter);
format.SetLineAlignment(StringAlignmentNear);
Gdiplus::Font clrFont(L"Arial",65,FontStyleRegular,UnitPixel );
SolidBrush blackBrush(Color(255, 0, 0, 0));
RectF rcText(PointF(rcBounds.left-m_fSideWidth*cxInch*0.9,rcBounds.top+nw+txtSize/2),SizeF(txtSize,txtSize));
PointF txtPoint[4]={
PointF(rcText.GetLeft(),rcText.GetTop()),
PointF(rcText.GetRight(),rcText.GetTop()),
PointF(rcText.GetLeft(),rcText.GetBottom()),
PointF(rcText.GetRight(),rcText.GetBottom())
};
graph.RotateTransform(REAL(-90)); // 旋转 角度
graph.TransformPoints(CoordinateSpaceWorld,CoordinateSpacePage,txtPoint,4);//求旋转后的位置
RectF rcTrText(txtPoint[0],SizeF(txtSize,txtSize));
graph.DrawString(IntToStr(nw/cxInch),-1,&clrFont,rcTrText,&format,&blackBrush);
graph.ResetTransform();
format.SetAlignment(StringAlignmentCenter);
format.SetLineAlignment(StringAlignmentNear);
Gdiplus::Font clrFont(L"Arial",65,FontStyleRegular,UnitPixel );
SolidBrush blackBrush(Color(255, 0, 0, 0));
RectF rcText(PointF(rcBounds.left-m_fSideWidth*cxInch*0.9,rcBounds.top+nw+txtSize/2),SizeF(txtSize,txtSize));
PointF txtPoint[4]={
PointF(rcText.GetLeft(),rcText.GetTop()),
PointF(rcText.GetRight(),rcText.GetTop()),
PointF(rcText.GetLeft(),rcText.GetBottom()),
PointF(rcText.GetRight(),rcText.GetBottom())
};
graph.RotateTransform(REAL(-90)); // 旋转 角度
graph.TransformPoints(CoordinateSpaceWorld,CoordinateSpacePage,txtPoint,4);//求旋转后的位置
RectF rcTrText(txtPoint[0],SizeF(txtSize,txtSize));
graph.DrawString(IntToStr(nw/cxInch),-1,&clrFont,rcTrText,&format,&blackBrush);
graph.ResetTransform();
相关文章推荐
- GDI+文字旋转
- C#利用GDI+绘制旋转文字等效果
- C# 使用 GDI+ 实现添加中心旋转(任意角度)的文字
- C#中基于GDI+(Graphics)图像处理系列之文字或者图片水印(透明、任意角度旋转)
- 图片放大后,右下角文字位置跟随一起变化
- Css3做的旋转显示文字和角度的变化
- C# 使用 GDI+ 实现添加中心旋转(任意角度)的文字
- GDI+简单现实文字旋转
- C#利用GDI+绘制旋转文字,矩形内可以根据布局方式排列文本
- C#利用GDI+绘制旋转文字等效果实例
- IOS---transform(控件位置,大小,旋转变化)
- 转载:GDI+绘制文字的位置偏移分析
- VISIO 2003档案打印至Adobe PDF时,有文字位置/大小/字体 发生变化 的修正方法
- 文字显示位置随着进度变化
- ios 自定义键盘输入框 输入框跟随文字换行变宽 输入框随着键盘消失出现位置进行变化
- GDI+简单现实文字旋转
- php 给图片添加文字水印 可控制位置,旋转,多行文字
- GDI+文字旋转
- GDI+简单现实文字旋转
- div位置大小不随浏览器变化而变化