J'ai PB 4.60 Béta 3 et il y a une chose que je ne m'explique pas quand je fait :
Code : Tout sélectionner
EnableExplicit
UseJPEGImageDecoder()
LoadImage(0, "Effet.jpg")
Define ImageX.l = ImageWidth(0)
Define ImageY.l = ImageHeight(0)
Define block.l
Define event.l
Define x.l
Define y.l
Define Couleur.l
If OpenWindow(0, 0, 0, ImageX, ImageY,"Pixellisation", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
StartDrawing(WindowOutput(0))
DrawImage(ImageID(0), 0, 0)
Repeat
Event = WaitWindowEvent()
If Event = #WM_LBUTTONDOWN
block + 1
For x = 0 To ImageX-block Step block
For y = 0 To ImageY-block Step block
Couleur = Point(x, y)
Box(x, y, block, block, Couleur)
Next y
Next x
EndIf
Until Event = #WM_CLOSE
StopDrawing()
EndIf
Si je retire la contante "block" la plus de problème exemple :
Code : Tout sélectionner
EnableExplicit
UseJPEGImageDecoder()
LoadImage(0, "Effet.jpg")
Define ImageX.l = ImageWidth(0)
Define ImageY.l = ImageHeight(0)
;Define block.l
Define event.l
Define x.l
Define y.l
Define Couleur.l
If OpenWindow(0, 0, 0, ImageX, ImageY,"Pixellisation", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
StartDrawing(WindowOutput(0))
DrawImage(ImageID(0), 0, 0)
Repeat
Event = WaitWindowEvent()
If Event = #WM_LBUTTONDOWN
;block + 1
For x = 0 To ImageX-4 Step 4
For y = 0 To ImageY-4 Step 4
Couleur = Point(x, y)
Box(x, y, 4, 4, Couleur)
Next y
Next x
EndIf
Until Event = #WM_CLOSE
StopDrawing()
EndIf
Merci d'avance,
GallyHC