Menu

GET, PUT, PUT_BITMAP on Windows and Android

Wanderer
2015-12-13
2015-12-20
  • Wanderer

    Wanderer - 2015-12-13

    I think I already wrote about these in respect to an earlier version this year, but I thought I'd better open a new thread so it does not get mixed up with other topics. I tested now again with the latest version.

    I ran the following test program several times with different coordinates, testing especially some cases where the rectangle is partially outside the screen:

    For i% = 1 To 255
      Color get_color(i%*256, 0, 65535)
      Line 0,i%, 160,i%
    Next i%
    
    Get 0,0,32,10,img1$
    Get -10,0,32,200,img2$
    Put 168,10,img1$
    Put 204,20,img2$
    Showpage
    Input x$
    End
    

    Results:
    - The former bug in the Windows version where GET used the width parameter for both width and height does no longer appear.
    - GET seems to correct negative x/y coordinates automatically to zero. (I would have expected that in this case it would retrieve a smaller rectangle, or a partially blacked-out rectangle. It would be good to specify in the manual what behaviour to expect if the rectangle is partially or completely off the screen, or larger than the screen. - I did not yet test with a rectangle larger than the screen.)
    - The Android version crashes sometimes when the rectangle to be PUT is partially outside the screen; sometimes it keeps running but the part of the rectangle which is inside the screen is not shown.

    • By the way, the Android version still crashes with a "Divide by zero" error when trying to PUT an 8-bit bitmap.

    Test program for PUT_BITMAP:

    bmp$ = "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
    graphmode 2
    Color get_color(65535,65535,0), get_color(32000,0,32000) 
    pbox 90,108,120,120
    put_bitmap bmp$, 100,100, 16,16  
    Showpage
    Input n$
    End
    

    In the Windows version, the bitmap appears, but inverted (0 shows as white and 1 as black). Also, GRAPHMODE seems not to have any effect on PUT_BITMAP; the bitmap overwrites always its whole background (no transparency). - Actually, the manual says that the bitmap should appear with the colors specified by the COLOR statement. This is not the case; it was always black and white.

    In the Android version, the bitmap does not appear at all.

     
  • Markus Hoffmann

    Markus Hoffmann - 2015-12-15

    PUT_BITMAP was fixed for the Android Version. The next release will have that implemented.

    If the coordinates of GET are outside the screen or window, the current behaviour is to set them to zero (for x,y,) and to reduce size (w,h,) to avoid a crash.

    If the coordinates of PUT are outside the screen, the command is ignored to avoid a crash.

    You should avoid to have coordinates outside the screen. You can ask for the screen dimensions with GET_GEOMETRY.

     
    • Wanderer

      Wanderer - 2015-12-20

      Great that this will be fixed.

      Having coordinates of a sprite partially outside the screen would be very useful in animations, e.g. for having a sprite entering the screen from one side and leaving it on the other side, etc. - Also for showing an image which is larger than the screen and letting the user scroll around in the image.
      Since PUT allows now specifying a source rectangle (although I did not yet test this feature), I can now of course do all this errorchecking from my own program and "cut" the sprites accordingly... only that it would be very convenient to have this feature already built-in within the compiler.

       
  • Markus Hoffmann

    Markus Hoffmann - 2015-12-15

    PUT_BITMAP is now also fixed for the WINDOWS version. The next release will have the bitmap drawn with the color and graphmode settings.

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.