Matrix->Spiegeln

  • Allgemein

Es gibt 1 Antwort in diesem Thema. Der letzte Beitrag () ist von Tsuyo.

    Matrix->Spiegeln

    Nabend, ich Drehe mit Matrix ein Bild. Jedoch möchte ich, das es nun auch nochmal Horizontal gespiegelt wird.

    VB.NET-Quellcode

    1. Public Function Rotate(ByVal Image As Image, ByVal Angle As Integer) As Image
    2. Dim bmp As New Bitmap(coverbreite, coverhoehe)
    3. Dim m As New Drawing2D.Matrix
    4. m.RotateAt(Angle, New PointF(CSng(coverbreite / 2), CSng(coverhoehe / 2)))
    5. With Graphics.FromImage(bmp)
    6. .Transform = m
    7. .DrawImage(Image, 0, 0)
    8. End With
    9. Return CType(bmp, Image)
    10. End Function


    diese Funktion nutze ich im moment, Funktioniert auch, jedoch weiss ich nicht wie ich es jetzt noch spiegeln soll.

    Grüße
    Für Wissenshungrige, mein funktionierender Code:

    VB.NET-Quellcode

    1. Function spiegel(ByVal img As Image, ByVal width As Integer, ByVal height As Integer) As Image
    2. Dim bmp As New Bitmap(width, height)
    3. With Graphics.FromImage(bmp)
    4. .DrawImage(img, 0, 0, width, height)
    5. End With
    6. bmp.RotateFlip(RotateFlipType.RotateNoneFlipY)
    7. Return CType(bmp, Image)
    8. End Function