ton exemple ma fait comprendre ce que tu voulais.
avec le souris et de la redimensionner, et .... de flèches en flèches
alors voila de la dynamique pour tes flèches.
Je sais pas si ca va te plaire, mais je trouve ce résultat intéressant.
Code : Tout sélectionner
; #####################################################
; ####### kernadec en janvier 2010 ######
; sur l'dée de fleche du projet KCC
; flèche au choix 8 directions avec la molette
; deplacement clic gauche taille clic droit
; #####################################################
#WM_MOUSEWHEEL = $20A
Enumeration
#Fenetre
#Image_0
#Image_1
#ImageGadget
#boutonGadget_0
#boutonGadget_1
#boutonGadget_2
#boutonGadget_3
EndEnumeration
Global dc.l,epais.l,fleche.l,px.l
winl.l=800
winh.l=600
Posx.l=0
Posy.l=0
Posl.l=300
Posh.l=300
epais=20
Px=45
Procedure.w MouseWheelDelta()
z.w=((EventwParam()>>16)&$FFFF)
ProcedureReturn -(z/100)
EndProcedure
Procedure Ligne(x,y,x1,y1,Width,color)
pen=CreatePen_(#PS_SOLID,Width,color)
penOld=SelectObject_(DC,pen)
MoveToEx_(DC,x,y,0):LineTo_(DC,x1,y1)
DeleteObject_(pen)
DeleteObject_(penOld)
EndProcedure
Procedure dessin(Posx,Posy,Posl,Posh)
DisableGadget(#ImageGadget,0)
dc=StartDrawing( ImageOutput(#Image_1))
Box(0,0,WindowWidth(#Fenetre),WindowHeight(#Fenetre),RGB(225,225,225))
DrawImage(ImageID(#Image_0),Posx,Posy,Posl,Posh)
If fleche=0
Ligne(Posx,Posy+px,Posx+Posl-px,Posy+px,epais,RGB(226,23,29)) ; Horizontale
Ligne(Posx+Posl-px,Posy+px,Posx+Posl-px,Posy+Posh-px,epais,RGB(226, 23, 29)) ; Verticale
Ligne(Posx+Posl-px,Posy+Posh-px,Posx+Posl-px/2*3,Posy+Posh-px*2,epais,RGB(226, 23, 29))
Ligne(Posx+Posl-px,Posy+Posh-px,Posx+Posl-px/2,Posy+Posh-px*2,epais,RGB(226, 23, 29))
EndIf
If fleche=1
Ligne(Posx+px,Posy+Posh-px,Posx+Posl-px,Posy+Posh-px,epais,RGB(226, 23, 29)) ; Horizontale
Ligne(Posx+px,Posy,Posx+px,Posy+Posh-px,epais,RGB(226, 23, 29)) ; Verticale
Ligne(Posx+Posl-px*2,Posy+Posh-px/2*3,Posx+Posl-px,Posy+Posh-px,epais,RGB(226, 23, 29))
Ligne(Posx+Posl-px*2,Posy+Posh-px/2,Posx+Posl-px,Posy+Posh-px,epais,RGB(226, 23, 29))
EndIf
If fleche=2
Ligne(Posx+px,Posy+px,Posx+Posl,Posy+px,epais,RGB(226, 23, 29)) ; Horizontale
Ligne(Posx+px,Posy+px,Posx+px,Posy+Posh-px,epais,RGB(226, 23, 29)) ; Verticale
Ligne(Posx+px,Posy+Posh-px,Posx+px/2*3,Posy+Posh-px*2,epais,RGB(226, 23, 29))
Ligne(Posx+px,Posy+Posh-px,Posx+px/2,Posy+Posh-px*2,epais,RGB(226, 23, 29))
EndIf
If fleche=3
Ligne(Posx+px,Posy+Posh-px,Posx+Posl-px,Posy+Posh-px,epais,RGB(226, 23, 29)) ; Horizontale
Ligne(Posx+Posl-px,Posy,Posx+Posl-px,Posy+Posh-px,epais,RGB(226, 23, 29)) ; Verticale
Ligne(Posx+px*2,Posy+Posh-px/2*3,Posx+px,Posy+Posh-px,epais,RGB(226, 23, 29))
Ligne(Posx+px*2,Posy+Posh-px/2,Posx+px,Posy+Posh-px,epais,RGB(226, 23, 29))
EndIf
If fleche=4
Ligne(Posx+px,Posy+Posh-px,Posx+Posl,Posy+Posh-px,epais,RGB(226, 23, 29)) ; Horizontale
Ligne(Posx+px,Posy+px,Posx+px,Posy+Posh-px,epais,RGB(226, 23, 29)) ; Verticale
Ligne(Posx+px,Posy+px,Posx+px/2*3,Posy+px*2,epais,RGB(226, 23, 29))
Ligne(Posx+px,Posy+px,Posx+px/2,Posy+px*2,epais,RGB(226, 23, 29))
EndIf
If fleche=5
Ligne(Posx+px,Posy+px,Posx+Posl-px,Posy+px,epais,RGB(226, 23, 29)) ; Horizontale
Ligne(Posx+Posl-px,Posy+px,Posx+Posl-px,Posy+Posh,epais,RGB(226, 23, 29)) ; Verticale
Ligne(Posx+px*2,Posy+px/2*3,Posx+px,Posy+px,epais,RGB(226, 23, 29))
Ligne(Posx+px*2,Posy+px/2,Posx+px,Posy+px,epais,RGB(226, 23, 29))
EndIf
If fleche=6
Ligne(Posx,Posy+Posh-px,Posx+Posl-px,Posy+Posh-px,epais,RGB(226, 23, 29)) ; Horizontale
Ligne(Posx+Posl-px,Posy+px,Posx+Posl-px,Posy+Posh-px,epais,RGB(226, 23, 29)) ; Verticale
Ligne(Posx+Posl-px,Posy+px,Posx+Posl-px/2*3,Posy+px*2,epais,RGB(226, 23, 29))
Ligne(Posx+Posl-px,Posy+px,Posx+Posl-px/2,Posy+px*2,epais,RGB(226, 23, 29))
EndIf
If fleche=7
Ligne(Posx+px,Posy+px,Posx+Posl-px,Posy+px,epais,RGB(226, 23, 29)) ; Horizontale
Ligne(Posx+px,Posy+px,Posx+px,Posy+Posh,epais,RGB(226, 23, 29)) ; Verticale
Ligne(Posx+Posl-px*2,Posy+px/2*3-y1,Posx+Posl-px,Posy+px-y1,epais,RGB(226, 23, 29))
Ligne(Posx+Posl-px*2,Posy+px/2-y1,Posx+Posl-px,Posy+px-y1,epais,RGB(226, 23, 29))
EndIf
StopDrawing()
ButtonGadget(#boutonGadget_0, 120,80, 50, 30, "texte" )
ButtonGadget(#boutonGadget_1, 440,180, 50, 30, "texte" )
ButtonGadget(#boutonGadget_2, 240,390, 50, 30, "texte" )
ButtonGadget(#boutonGadget_3, 620,290, 50, 30, "texte" )
Delay(2)
DisableGadget(#ImageGadget,1)
SetGadgetState(#ImageGadget,ImageID(#Image_1))
EndProcedure
OpenWindow(#Fenetre, 0, 0,winl,winh, "",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
CreateImage(#Image_0,winl,winh)
CreateImage(#Image_1,winl,winh)
StartDrawing(ImageOutput(#Image_0))
Box(0,0,winl,winh,RGB(255,255,255))
StopDrawing()
ImageGadget(#ImageGadget,Posx,Posy,200,200,ImageID(#Image_0))
ButtonGadget(#boutonGadget_0, 120,80, 50, 30, "texte" )
ButtonGadget(#boutonGadget_1, 440,180, 50, 30, "texte" )
ButtonGadget(#boutonGadget_2, 240,390, 50, 30, "texte" )
ButtonGadget(#boutonGadget_3, 620,290, 50, 30, "texte" )
SetGadgetState(#ImageGadget,ImageID(#Image_0))
dessin(Posx,Posy,Posl,Posh)
bm=#False
Repeat
event = WaitWindowEvent(1)
Select Event
Case #PB_Event_Gadget
Select EventGadget()
Case #boutonGadget_0
Debug "B0"
Case #boutonGadget_1
Debug "B1"
Case #boutonGadget_2
Debug "B2"
Case #boutonGadget_3
Debug "B3"
EndSelect
EndSelect
If event=#WM_MOUSEWHEEL
fleche+Abs(MouseWheelDelta())
fleche=fleche%8
If fleche>7:fleche=7:EndIf
dessin(Posx,Posy,Posl,Posh)
EndIf
If GetAsyncKeyState_(#VK_LBUTTON) Or GetAsyncKeyState_(#VK_RBUTTON)
If event=#WM_RBUTTONUP
bm=#False
EndIf
If event=#WM_LBUTTONUP
bm=#False
EndIf
If event=#WM_LBUTTONDOWN
bm=#True
Posx1 = WindowMouseX(0)-Posx
Posy1 = WindowMouseY(0)-Posy
EndIf
If event=#WM_RBUTTONDOWN
bm=#True
Posl1 = WindowMouseX(0)-Posl
Posh1 = WindowMouseY(0)-Posh
EndIf
EndIf
If event=#WM_MOUSEMOVE
If bm=#True
If GetAsyncKeyState_(#VK_LBUTTON)
Posx = WindowMouseX(0)-Posx1
Posy = WindowMouseY(0)-Posy1
dessin(Posx,Posy,Posl,Posh)
EndIf
EndIf
If GetAsyncKeyState_(#VK_RBUTTON)
Posl=WindowMouseX(0)-Posl1
Posh=WindowMouseY(0)-Posh1
dessin(Posx,Posy,Posl,Posh)
EndIf
EndIf
Until event = #PB_Event_CloseWindow