Bild spiegeln?
Verfasst: 05.02.2009 18:34
Hallo, ich versuche gerade eine Prozedur zum spiegeln eines Images zu schreiben.
und ich blicke nicht ganz durch warum mein Lösungsansatz nicht funktioniert ...
Keine Fehlermeldung .. Bild bleibt gleich
MfG Tompazi
und ich blicke nicht ganz durch warum mein Lösungsansatz nicht funktioniert ...
Keine Fehlermeldung .. Bild bleibt gleich
Code: Alles auswählen
Procedure Mirror(ImageID,Mode) ;; Mode: 0 = Vertical; 1 = Horizontal
Structure Pix
x.w
y.w
color.l
EndStructure
NewList Pixel.Pix()
StartDrawing(ImageOutput(0))
If Mode = 1
FirstElement(Pixel())
For y = ImageHeight(0) - 1 To 0 Step -1
For x = 0 To ImageWidth(0) - 1
AddElement(Pixel())
Pixel()\x = x
Pixel()\y = y
Pixel()\color = Point(x,y)
Next x
Next y
Else
FirstElement(Pixel())
For y = 0 To ImageHeight(0) - 1
For x = ImageWidth(0) - 1 To 0 Step -1
AddElement(Pixel())
Pixel()\x = x
Pixel()\y = y
Pixel()\color = Point(x,y)
Next x
Next y
EndIf
FirstElement(Pixel())
ForEach Pixel()
Plot(Pixel()\x,Pixel()\y,Pixel()\color)
Next
StopDrawing()
ClearList(Pixel())
EndProcedure