図形のテキストと背景色がテキスト文字列に基づいている数百の基本的なグラフィックスを生成しようとしています。
このために、私は PowerPoint を使用することを選択しました。これは、画像のスタイリングが私の機能にとって非常に包括的であると感じているためです。これを行う方法を知っている唯一のプログラムは Adobe Photoshop ですが、そのソフトウェアは持っていません。
画像のエクスポート機能が動作するようになりましたが、エクスポートされたグラフィックの画質がひどいです
より良い画像プロセッサでこれを行うにはどうすればよいですか?
ご覧のとおり、文字列値 (Rectangle 5) を保持するテキスト ボックスと、テキスト文字列の 2 つの RGB 値によってスタイル設定される「形状」を備えた PowerPoint スライドがあります。文字列値の形式は次のとおりです (パイプ区切り)
- テキストボックス 4.名前 | 角丸長方形 角丸長方形 3.色
使用したコード:
Private Sub btnProcess_Click()
Dim i As Integer
Dim StringsArray As Variant
Dim StringItems As Variant
' Call getlines to break all lines into separate records in stringsarray
StringsArray = getlines()
For i = 0 To UBound(StringsArray)
StringItems = Split(StringsArray(i), "|")
ActivePresentation.Slides("Slide1").Shapes("TextBox 4").TextFrame.TextRange.Text = StringItems(0)
ActivePresentation.Slides("Slide1").Shapes("Rounded Rectangle 7").Fill.ForeColor.RGB = StringItems(1)
ActivePresentation.Slides("Slide1").Shapes("Rounded Rectangle 3").Fill.ForeColor.RGB = StringItems(2)
ActivePresentation.Slides("Slide1").Shapes("Group 6").Export "C:\temp\file.emf", ppShapeFormatEMF, 150, 150, ppRelativeToSlide
Next i
End Sub
Function getlines() As Variant
Dim mylines As Variant
Dim mytext As String
mytext = ActivePresentation.Slides("Slide1").Shapes("Rectangle 5").TextFrame.TextRange.Text
mylines = Split(mytext, vbCr)
getlines = mylines
End Function