作成日: 2020/07/29 最終更新日: 2020/07/29
文書種別
使用方法
詳細
GcPdfGraphicsのTransformプロパティに拡大縮小行列を設定すると長体や平体を描画できます。
◆サンプルコード(C#)
◇参考情報
Matrix3x2.CreateScale メソッド (System.Numerics) | Microsoft Docs
◆サンプルコード(C#)
var doc = new GcPdfDocument();
var page = doc.NewPage();
var g = page.Graphics;
var tl = g.CreateTextLayout();
tl.DefaultFormat.Font = FontCollection.SystemFonts.FindFamilyName("MS ゴシック");
tl.DefaultFormat.FontSize = 24;
tl.AppendLine("グレープシティ");
tl.PerformLayout(true);
// 長体
var p1 = new PointF(72, 72);
g.Transform = Matrix3x2.CreateScale(0.5f, 1.0f, new Vector2(p1.X, p1.Y));
g.DrawTextLayout(tl, p1);
// 平体
var p2 = new PointF(72, 144);
g.Transform = Matrix3x2.CreateScale(1.0f, 0.5f, new Vector2(p2.X, p2.Y));
g.DrawTextLayout(tl, p2);
// 保存
doc.Save("sample.pdf");
◇参考情報
Matrix3x2.CreateScale メソッド (System.Numerics) | Microsoft Docs
旧文書番号
85842