Here we add an image without transparency and then, at a
position down and to the right, with 50% transparency.
using (Doc doc = new Doc()) {
doc.Rect.Pin = XRect.Corner.TopLeft;
doc.Rect.Magnify(0.5, 0.5);
string thePath = Server.MapPath("../mypics/mypic.jpg");
doc.AddImageFile(thePath, 1);
doc.Rect.Move(doc.Rect.Width, -doc.Rect.Height);
int i = doc.AddImageFile(thePath, 1);
ImageLayer im = (ImageLayer)doc.ObjectSoup[i];
im.PixMap.SetAlpha(128);
doc.Save(Server.MapPath("pixmapsetalpha.pdf"));
}
Using doc As New Doc()
doc.Rect.Pin = XRect.Corner.TopLeft
doc.Rect.Magnify(0.5, 0.5)
Dim thePath As String = Server.MapPath("../mypics/mypic.jpg")
doc.AddImageFile(thePath, 1)
doc.Rect.Move(doc.Rect.Width, -doc.Rect.Height)
Dim i As Integer = doc.AddImageFile(thePath, 1)
Dim im As ImageLayer = DirectCast(doc.ObjectSoup(i), ImageLayer)
im.PixMap.SetAlpha(128)
doc.Save(Server.MapPath("pixmapsetalpha.pdf"))
End Using