Found an issue in SpiderBasic ? Please report it here !
User avatar
Arbrakaan
 
Posts: 87
Joined: Mon Feb 24, 2014 10:54 pm
Location: Geneva

2.21 : Point() return 0

by Arbrakaan Thu Apr 04, 2019 7:05 pm

Hi all,

I can't get the color from Point(), it return 0.

I'm doing something wrong ?

( SpiderBasic 2.21 (Windows - x86) )

This code work well on PB btw.

Code: Select all

      OpenWindow(0, 10, 10, 256, 256, "Canvas", #PB_Window_SizeGadget)

      CanvasGadget(0,0,0,256,256)
      StartDrawing(CanvasOutput(0))
       Box(0, 0, 256, 256, RGB(255,127,254))
        For i=0 To 256
          Debug   Red(Point(i, 4))
        Next i
       StopDrawing()
       
       
       
      OpenWindow(1, 300, 10, 256, 256, "Canvas", #PB_Window_SizeGadget)

      CanvasGadget(1,0,0,256,256)
      StartDrawing(CanvasOutput(1))
      Box(0, 0, 256, 256, RGB(255,255,0))
      StopDrawing()
      StartDrawing(CanvasOutput(1))
        For i=0 To 256
          Debug   Red(Point(i, 4))
        Next i
      StopDrawing()
munfraid
 
Posts: 29
Joined: Sat Mar 24, 2018 1:33 pm

Re: 2.21 : Point() return 0

by munfraid Fri Apr 19, 2019 1:10 pm

Works as expected here, but since your image is 256*256 you might want to change both loops from
Code: Select all
For i=0 To 256

to
Code: Select all
For i=0 To 255

You did 257 iterations, so the last one gave 0 because it doesn't exist.
But it's true that PureBasic shows a different result, and that's unexpected.
Maybe Fred would like to take a look.
User avatar
Arbrakaan
 
Posts: 87
Joined: Mon Feb 24, 2014 10:54 pm
Location: Geneva

Re: 2.21 : Point() return 0

by Arbrakaan Fri Apr 19, 2019 3:17 pm

:oops:

Thanks ;)
Return to Bugs Reports

Who is online

Users browsing this forum: No registered users and 4 guests