I would like to rotate an image. I create a function (see it bellow) that add an image into the PDF file. However I can't find how to rotate it.
Code: Select all
Private Function AddStampToPdfFile(ByVal iPage As Integer, ByVal pImage As Image, ByVal stmpLocation As Point, Optional ByVal Opacity As Integer = 100) As GdPicture9.GdPictureStatus
Dim bm As Bitmap = New Bitmap(pImage)
Dim ImageID As Integer = oGdPictureImaging.CreateGdPictureImageFromBitmap(bm)
If ImageID <> 0 Then
oGdPicturePDF.SelectPage(iPage)
Dim Ps As Integer = oGdPicturePDF.PrintGetPaperSize
Dim pW = oGdPicturePDF.GetPageWidth
Dim X As Integer = pW - stmpLocation.X - bm.Width
Dim sLocX = pW - bm.Width - X
Dim image_res_name As String = oGdPicturePDF.AddImageFromGdPictureImage(ImageID, False, False)
oGdPictureImaging.ReleaseGdPictureImage(ImageID)
oGdPicturePDF.SetOrigin(PdfOrigin.PdfOriginTopRight)
oGdPicturePDF.SetMeasurementUnit(PdfMeasurementUnit.PdfMeasurementUnitPoint)
If Opacity > 0 And Opacity < 100 Then
oGdPicturePDF.SetFillAlpha(Opacity)
End If
Return oGdPicturePDF.DrawImage(image_res_name, sLocX, stmpLocation.Y, bm.Width, bm.Height)
End If
End Function