Salut,
parfois, quand j'etais sur le bureau de windows avec mon image en fond, le haut de l'ecran (1 tiers de la hauteur) etait parasité. Je me disais que c'était probablement un faux contact dans mon ordi mais j'ai enfin trouvé ce qui se passe.
En fait, sur mon ecran plat, on peux regler automatiquement la meilleure position de l'image selon la resolution. Et je me suis appercu que quand je faisais ce reglage sur un screen open de PB et que je repassais sur le bureau de windows, des parasites apparaissaient (ainsi que des fontes degoulinantes).
Apparement, le screenopen doit etre de la meme resolution que le bureau. Moi, j'ai le bureau en 1280*1024.
Donc, si votre bureau est aussi en 1280/1024, essayez ce code puis autoréglez votre moniteur puis quittez ce code et allez matter le bureau de windows. Regardez particulierement le premier tiers de l'ecran. Est il parasité ????
Ma premiere impression est que le 1280/1024 d'un screenopen de PB soit tres tres tres legerement decallé par rapport a un 1280/1024 de windows (faute a ma CG, a mon moniteur ou a PB, je n'en sais rien pour le moment)
Code : Tout sélectionner
InitSprite()
InitKeyboard()
dw=1280
dh=1024
dc=32
If OpenScreen(dw,dh,dc,"SPH_Snake")=0
End
EndIf
StartDrawing(ScreenOutput())
MemVideo = DrawingBuffer()
dbp=DrawingBufferPitch()
dbpf=DrawingBufferPixelFormat()
;1= #PB_PixelFormat_8Bits ; 1 bytes per pixel, palletized
;2= #PB_PixelFormat_15Bits ; 2 bytes per pixel
;3= #PB_PixelFormat_16Bits ; 2 bytes per pixel
;4= #PB_PixelFormat_24Bits_RGB ; 3 bytes per pixel (RRGGBB)
;5= #PB_PixelFormat_24Bits_BGR ; 3 bytes per pixel (BBGGRR)
;6= #PB_PixelFormat_32Bits_RGB ; 4 bytes per pixel (RRGGBB)
;7= #PB_PixelFormat_32Bits_BGR ; 4 bytes per pixel (BBGGRR)
StopDrawing()
Debug dbp
;End
;Dim p(dh-1,dw-1)
Dim p(dh-1,dbp/4-1)
;Points blancs aux 4 coins
p(0,0)=RGB(255,255,255)
p(0,dw-1)=RGB(255,255,255)
p(dh-1,dw-1)=RGB(255,255,255)
p(dh-1,0)=RGB(255,255,255)
;Points de couleur en retrait
p(5,5)=RGB(255,0,255)
p(5,dw-6)=RGB(255,0,255)
p(dh-6,dw-6)=RGB(255,0,255)
p(dh-6,5)=RGB(255,0,255)
; d'autre points pour bien signaler l'angle haut gauche
; car un bug apparait en resolution 1280/1024 !!
p(15,15)=RGB(0,255,255)
p(25,25)=RGB(0,255,255)
p(35,35)=RGB(0,255,255)
p(45,45)=RGB(0,255,255)
p(55,55)=RGB(0,255,255)
p(65,65)=RGB(0,255,255)
p(75,75)=RGB(0,255,255)
p(85,85)=RGB(0,255,255)
p(95,95)=RGB(0,255,255)
;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;
Repeat
StartDrawing(ScreenOutput())
MemVideo = DrawingBuffer()
If Random(1)>5 ;je force l'execution de ELSE
For u=0 To dh-1
CopyMemory(@p(u,0), MemVideo+DrawingBufferPitch()*u,dw*4)
Next
Else
MemVideo = DrawingBuffer()
CopyMemory(@p(), MemVideo, dh*dbp)
EndIf
StopDrawing()
FlipBuffers()
Delay(1)
ExamineKeyboard()
Until KeyboardPushed(#PB_Key_Escape)