At last I have managed to recover my forum account.
Here is small bug I found some months ago while wanted to draw vertical lines with LineXY(...RGBA()) using DrawingMode(#PB_2DDrawing_AlphaClip).
Code: Select all
;
; A bug when drawing a _vertical_ alpha line with LineXY(x1,y1,x2,y2,RGBA()) using DrawingMode(#PB_2DDrawing_AlphaClip)
;
; try with a low alpha value (default), and play with the X-slider (top right):
; - the rotated line will appear with "Alpha 255" when it is exactly vertical,
; - the line will have a false color,
; - changing the _Alpha_ value changes the _Color_ of the line
; (seems like mixed r-g-b-a values somewhere in the "background")
;
; discovered in PB 5.11, Windows 7 Starter (x86) - English
; still reproducible in PB 5.20 LTS, Windows 7 Starter (x86) - English
;
; Top row: Normal Drawing (no bugs, just to compare the two drawing modes)
; Bottom row: Alpha Drawing (the strange one)
Enumeration ; Gadgets
#canvas
#trkR
#trkG
#trkB
#trkAlpha
#trkX
#trkY
#txtR
#txtG
#txtB
#txtAlpha
#txtX
#txtY
EndEnumeration
Global r,g,b,a,x,y
Declare TestDrawing()
If OpenWindow(0, #PB_Any, #PB_Any, 600, 480, "Main Window", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_ScreenCentered)
CanvasGadget(#canvas, 20, 60, 520, 300)
TextGadget(#txtAlpha, 20, 0, 200, 20, "Alpha:", #PB_Text_Center)
TrackBarGadget(#trkAlpha, 20, 25, 200, 20, 0, 255)
SetGadgetState(#trkAlpha, 30)
TextGadget(#txtX, 250, 0, 300, 20, "X:", #PB_Text_Center)
TrackBarGadget(#trkX, 250, 25, 300, 20, 0, 100) : SetGadgetState(#trkX, 50)
TextGadget(#txtY, 550, 40, 40, 20, "Y:", #PB_Text_Center)
TrackBarGadget(#trkY, 550, 60, 40, 300, 0, 100, #PB_TrackBar_Vertical) : SetGadgetState(#trkY, 100)
TextGadget(#txtR, 320, 380, 100, 20, "R:")
TextGadget(#txtG, 320, 410, 100, 20, "G:")
TextGadget(#txtB, 320, 440, 100, 20, "B:")
TrackBarGadget(#trkR, 20, 380, 300, 20, 0, 255) : SetGadgetState(#trkR, 255)
TrackBarGadget(#trkG, 20, 410, 300, 20, 0, 255)
TrackBarGadget(#trkB, 20, 440, 300, 20, 0, 255)
Repeat
EventID = WaitWindowEvent()
r = GetGadgetState(#trkR)
g = GetGadgetState(#trkG)
b = GetGadgetState(#trkB)
a = GetGadgetState(#trkAlpha)
x = GetGadgetState(#trkX)
y = GetGadgetState(#trkY)
SetGadgetText(#txtR, "R: " + Str(r))
SetGadgetText(#txtG, "G: " + Str(g))
SetGadgetText(#txtB, "B: " + Str(b))
SetGadgetText(#txtAlpha, "Alpha: " + Str(a))
SetGadgetText(#txtX, "X: " + Str(x))
SetGadgetText(#txtY, "Y: " + Str(y))
TestDrawing()
Until EventID = #PB_Event_CloseWindow
EndIf ; OpenWindow
End
Procedure TestDrawing()
StartDrawing(CanvasOutput(#canvas))
DrawingMode(#PB_2DDrawing_Default)
Box(0, 0, GadgetWidth(#canvas), GadgetHeight(#canvas), RGB(255,255,255))
DrawText( 10, 10, "#PB_2DDrawing_Default", RGB(r,g,b))
LineXY( 10, 30, 10, 130, RGB(r,g,b))
LineXY(100, 30, 101, 130, RGB(r,g,b))
LineXY(300+x, 130-y , 400-x, 30+y, RGB(r,g,b))
DrawingMode(#PB_2DDrawing_AlphaClip)
DrawText( 10, 160, "#PB_2DDrawing_AlphaClip", RGBA(r,g,b,a))
LineXY( 10, 180, 10, 280, RGBA(r,g,b,a))
LineXY(100, 180, 101, 280, RGBA(r,g,b,a))
LineXY(300+x, 280-y, 400-x, 180+y, RGBA(r,g,b,a))
StopDrawing()
EndProcedure