Bonjour parole de JOJO
Avec effect de LSI Le Soldat Iconnu
http://www.lsi-dev.com/
Librairie Effect
Index des commandes :
GetImageBits
ImageSymmetryH
ImageSymmetryV
RotateImage
RotateImageEx
SetImageBits
RotateImage()
Syntaxe :
RotateImage(ImageID, Angle.l)
Description :
Rotation d'une image d'un angle multiple de 90°.
Le paramètre ImageID doit recevoir le handle d'une image. Par exemple : UseImage(#Image)
Le paramètre Angle doit recevoir un angle multiple de 90°. Par exemple 90, 180, 270, -90, -180, -270
La fonction retourne l'identifiant de l'image pivotée. (Ne pas confondre Identifiant et Handle)
Exemple :
Code : Tout sélectionner
ImageNormale = CreateImage(#PB_Any, 80, 100)
StartDrawing(ImageOutput())
Box(0, 0, 80, 100, $6F6F6F)
Box(5, 5, 35, 45, $FF)
Box(40, 5, 35, 45, $FF00)
Box(5, 50, 35, 45, $FF0000)
Box(40, 50, 35, 45, $FFFFFF)
StopDrawing()
If OpenWindow(0, 0, 0, 300, 300, #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_MinimizeGadget, "Effect - Rotation d'image") = 0 Or CreateGadgetList(WindowID()) = 0
End
EndIf
TextGadget(#PB_Any, 10, 10, 100, 15, "Image normale")
ImageGadget(#PB_Any, 10, 25, 0, 0, UseImage(ImageNormale))
TextGadget(#PB_Any, 120, 10, 100, 15, "Rotation de 90°")
ImageRotation90 = RotateImage(UseImage(ImageNormale), 90) ; ou -270°
ImageGadget(#PB_Any, 120, 25, 0, 0, UseImage(ImageRotation90))
TextGadget(#PB_Any, 10, 135, 100, 15, "Rotation de 180°")
ImageRotation180 = RotateImage(UseImage(ImageNormale), 180) ; ou -180°
ImageGadget(#PB_Any, 10, 150, 0, 0, UseImage(ImageRotation180))
TextGadget(#PB_Any, 120, 135, 100, 15, "Rotation de 270°")
ImageRotation270 = RotateImage(UseImage(ImageNormale), 270) ; ou -90°
ImageGadget(#PB_Any, 120, 150, 0, 0, UseImage(ImageRotation270))
Repeat
Event = WaitWindowEvent()
Until Event = #PB_EventCloseWindow
A+