Here we create a PDF document showing how different values of alpha
result in different levels of transparency.
[C#]
Doc theDoc = new Doc();
theDoc.Rect.Inset(20,20);
theDoc.FontSize = 300;
for (int i = 1; i <= 10; i++) {
theDoc.Color.Alpha = 255 / i;
theDoc.AddText(theDoc.Color.Alpha.ToString());
theDoc.Rect.Move(25, -50);
}
theDoc.Save(Server.MapPath("coloralpha.pdf"));
theDoc.Clear();
[Visual Basic]
Dim theDoc As Doc = New Doc()
theDoc.Rect.Inset(20,20)
theDoc.FontSize = 300
For i As Integer = 1 To 10
theDoc.Color.Alpha = 255 / i
theDoc.AddText(theDoc.Color.Alpha.ToString())
theDoc.Rect.Move(25, -50)
Next
theDoc.Save(Server.MapPath("coloralpha.pdf"))
theDoc.Clear()
coloralpha.pdf
|