Dim doc As New PrintDoc
Dim rt As New prt.RenderText '定义一个文本对象
rt.Text = "Hello Foxtable" '设置文本对象的内容
rt.Style.Font = New Font("宋体", 40f)
rt.x = 30
rt.y = 60
doc.Body.Children.Add(rt)
Dim colorAlpha As Single = 0.5 '透明度:0-1
Dim matrixItems = { New Single() { 1 , 0 , 0 , 0 , 0 }, New Single() { 0 , 1 , 0 , 0 , 0 }, New Single() { 0 , 0 , 1 , 0 , 0 }, New Single() { 0 , 0 , 0 , colorAlpha, 0 }, New Single() { 0 , 0 , 0 , 0 , 1 }}
Dim colorMatrix As New ColorMatrix(matrixItems)
Dim imageAtt As New ImageAttributes()
imageAtt.SetColorMatrix(colorMatrix, ColorMatrixFlag.Default, ColorAdjustType.Bitmap)
Dim img As Image = GetImage("1.png")
Dim rg1 As New prt.RenderGraphics()
rg1.Graphics.DrawImage(img, New Rectangle( 0 , 0 , 300, 300), 0, 0, img.Width, img.Height, GraphicsUnit.Pixel , imageAtt) '绘制透明
'rg1.Graphics.DrawImage(GetImage("1.png"), 0, 0, 300, 300) '绘制不透明
rg1.x = 30
rg1.y = 30
Doc.Body.Children.Add(rg1)
Doc.Preview()