Here we add an image without transparency and then, at a position
down and to the right, with 50% transparency.
[C#]
Doc theDoc = new Doc();
theDoc.Rect.Pin = XRect.Corner.TopLeft;
theDoc.Rect.Magnify(0.5, 0.5);
string thePath = Server.MapPath("../mypics/mypic.tif");
theDoc.AddImageFile(thePath, 1);
theDoc.Rect.Move(theDoc.Rect.Width, -theDoc.Rect.Height);
int i = theDoc.AddImageFile(thePath, 1);
ImageLayer im = (ImageLayer)theDoc.ObjectSoup[i];
im.PixMap.SetAlpha(128);
theDoc.Save(Server.MapPath("pixmapsetalpha.pdf"));
theDoc.Clear();
[Visual Basic]
Dim theDoc As Doc = New Doc()
theDoc.Rect.Pin = XRect.Corner.TopLeft
theDoc.Rect.Magnify(0.5, 0.5)
Dim thePath As String = Server.MapPath("../mypics/mypic.tif")
theDoc.AddImageFile(thePath, 1)
theDoc.Rect.Move(theDoc.Rect.Width, -theDoc.Rect.Height)
Dim i As Integer = theDoc.AddImageFile(thePath,1)
Dim im As ImageLayer = CType(theDoc.ObjectSoup(i), ImageLayer)
im.PixMap.SetAlpha(128)
theDoc.Save(Server.MapPath("pixmapsetalpha.pdf"))
theDoc.Clear()
pixmapsetalpha.pdf
|
|
|