var w = 800, h = 600
screenres w,h
dim as any ptr p = imagecreate(100,100)
if imageinfo( screenptr) = 0 then put screenptr, (0,0), p, pset
if imageinfo( p) = 0 then imagedestroy p
var w = 800, h = 600
screenres w,h
dim as any ptr p = imagecreate(100,100)
if imageinfo( screenptr) = 0 then put screenptr, (0,0), p, pset
if imageinfo( p) = 0 then imagedestroy p
Work correctly on Windows 10 64Bit ( FreeBASIC 1.09)
Work correctly on MS-DOS 6.22 (FreeBASIC 1.09)
Work correctly on Ubuntu UTC 2021 x86_64(FreeBASIC 1.09)
imageinfo( screenptr)
is invalid (aleatory result), because screenptr is not the address of an image buffer.
- In any case the instruction: put screenptr, (0,0), p, pset
is downright a bug because screenptr is not the address of an image buffer.
- To print an image buffer on the screen, the target image buffer pointer argument must be omitted: put (0,0), p, pset
fxm wrote: ↑Mar 15, 2022 16:43imageinfo( screenptr)
is invalid (aleatory result), because screenptr is not the address of an image buffer.
- In any case the instruction: put screenptr, (0,0), p, pset
is downright a bug because screenptr is not the address of an image buffer.
- To print an image buffer on the screen, the target image buffer pointer argument must be omitted: put (0,0), p, pset
Hi fxm , please can you explain why in MSDOS, Windows 10 and Linux Ubuntu work ?
Its something I done without know ?
I have a little problem to understand the graphics coding actually.
exagonx wrote: ↑Mar 15, 2022 19:01
Hi fxm , please can you explain why in MSDOS, Windows 10 and Linux Ubuntu work ?
Its something I done without know ?
Not crashing does not mean working!
Depending on the OS environment, an instruction using a dangling pointer may or may not crash.