Qbasicnews.com

Full Version: Qbish GFX lib bug
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
1.the lillo's lib draw some extra black vertical lines.
2.both libs ignore a block on the 1st character, and the upper vertical line on the last brick character is also lost in the 2 libs. this question might be within my source, but I donno where it is Sad
every binary picture has 48*48 dots, thus needs 48/8*48=288 bytes in chinese.pic
BTW: how to BLOAD and BSAVE in fbc?
you can also download the source file and pix at
http://bbs.whnet.edu.cn/upload/test.ZIP&...rogramming
Thanx.
[Image: 1106284226bug.gif&F=1106284226&B=Programming]

this is the original characters
[Image: bug-2.gif&F=1106283492&B=Programming]
Code:
Declare Function mycvi (i$)
Declare Sub ShowBinaryPix(x,y,colr,filenum)
cls
screen 12
Sub ShowBinaryPix(x,y,colr,filenum)
    x0=x:    y0=y
    For h = 1 TO 48
        dots$ = INPUT$(6, filenum)
        Line (x0, y0)-(x0 + 15, y0), colr, , mycvi!(LEFT$(dots$, 2))
        Line (x0 + 16, y0)-(x0 + 31, y0), colr, , mycvi!(MID$(dots$, 3, 2))
        Line (x0 + 32, y0)-(x0 + 47, y0), colr, , mycvi!(RIGHT$(dots$, 2))
        y0 = y0 + 1
    Next
End Sub

Function mycvi (i$)
    REM This works not like CVI, because the 2 bytes in i$ is not same
    mycvi = ASC(LEFT$(i$, 1)) * 256! + ASC(RIGHT$(i$, 1))
END FUNCTION

pix=FreeFile
Open "data/Chinese.pic" For binary as pix

ShowBinaryPix(0,10,12,pix)
ShowBinaryPix(50,10,12,pix)
ShowBinaryPix(2*50,10,12,pix)
ShowBinaryPix(3*50,10,12,pix)
ShowBinaryPix(4*50,10,12,pix)
ShowBinaryPix(5*50,10,12,pix)

Seek pix,1
ShowBinaryPix(0,10+50,9,pix)
ShowBinaryPix(50,10+50,9,pix)
ShowBinaryPix(2*50,10+50,9,pix)
ShowBinaryPix(3*50,10+50,9,pix)
ShowBinaryPix(4*50,10+50,9,pix)
ShowBinaryPix(5*50,10+50,9,pix)

Do
LOOP WHILE INKEY$ = ""            'Press any key to continue
Close all
What happens if you put a FLIP right before the do/loop near the end? (With my lib, some or all of the changes to the screen/palette might not take effect until you use FLIP)
Actually, you can't read binary data to a string, it will contain ch$(0)'s what is not allowed in FB, if you do:

Code:
Declare Sub ShowBinaryPix(x,y,colr,filenum)


cls
screen 12
Sub ShowBinaryPix(x,y,colr,filenum)
    dim s as ushort
    x0=x:    y0=y
    For h = 1 TO 48
        get #filenum, , s
        Line (x0, y0)-(x0 + 15, y0), colr, , (s shr 8) or (s and &hFF) shl 8
        get #filenum, , s
        Line (x0 + 16, y0)-(x0 + 31, y0), colr, , (s shr 8) or (s and &hFF) shl 8
        get #filenum, , s
        Line (x0 + 32, y0)-(x0 + 47, y0), colr, , (s shr 8) or (s and &hFF) shl 8
        y0 = y0 + 1
    Next
End Sub

pix=FreeFile
Open "data/Chinese.pic" For binary as pix

ShowBinaryPix 0,10,12,pix
ShowBinaryPix 50,10,12,pix
ShowBinaryPix 2*50,10,12,pix
ShowBinaryPix 3*50,10,12,pix
ShowBinaryPix 4*50,10,12,pix
ShowBinaryPix 5*50,10,12,pix

Seek pix,1
ShowBinaryPix 0,10+50,9,pix
ShowBinaryPix 50,10+50,9,pix
ShowBinaryPix 2*50,10+50,9,pix
ShowBinaryPix 3*50,10+50,9,pix
ShowBinaryPix 4*50,10+50,9,pix
ShowBinaryPix 5*50,10+50,9,pix

sleep
Close

Then Sterling's lib will render the chars without gaps, Angelo's stills missing the last bit or so.