wie kann ich ein Bild in einem Userform (Image) drehen - links - rechts 90°, 180°
https://www.herber.de/bbs/user/169590.xlsm
vielen Dank für Eure Hilfe
Pepi
Option Explicit
Public Function WIA_ImageRotation(Image As String, grd_rotImage As Long) As Boolean
On Error GoTo Fehler
Dim objImageFile As Object
Dim p_objImage As Object
Set objImageFile = CreateObject("WIA.ImageFile")
Set p_objImage = CreateObject("WIA.ImageProcess")
p_objImage.Filters.Add p_objImage.FilterInfos("RotateFlip").FilterID
p_objImage.Filters(1).Properties("RotationAngle") = grd_rotImage
objImageFile.LoadFile Image
Set objImageFile = p_objImage.Apply(objImageFile)
Kill Image
objImageFile.SaveFile Image
WIA_ImageRotation = True
Fehler_Exit:
On Error Resume Next
If Not p_objImage Is Nothing Then Set p_objImage = Nothing
If Not objImageFile Is Nothing Then Set objImageFile = Nothing
Exit Function
Fehler:
MsgBox "Lesen oder Schreiben nicht möglich.", vbCritical, "Zugriffsfehler"
Resume Fehler_Exit
End Function
Call WIA_ImageRotation(Cells(z, 2), 90) ' 90° links drehen 270