Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Why does this crash?
#1
Can anyone explain why the code below crashes?

Sometimes the Y value gets as high as a few hundred, other times just barely past 10.

I would have chalked this up as running out of memory but the random crash points has me confused. The picture I'm using is attached below.

Code: (Select All)
OPTION _EXPLICIT

TYPE TYPE_PIXEL
    hard AS LONG ' hardware image
    soft AS LONG ' software image
    ox AS INTEGER
    oy AS INTEGER
    x AS INTEGER
    y AS INTEGER
    xdir AS SINGLE
    ydir AS SINGLE

END TYPE

DIM Pixel(1280, 720) AS TYPE_PIXEL
DIM Picture AS LONG
DIM x AS INTEGER
DIM y AS INTEGER

SCREEN _NEWIMAGE(1280, 720, 32)
Picture = _LOADIMAGE("picture.png", 32)

_SOURCE Picture
FOR y = 0 TO 719
    FOR x = 0 TO 1279
        Pixel(x, y).soft = _NEWIMAGE(1, 1, 32)
        _DEST Pixel(x, y).soft
        PSET (0, 0), POINT(x, y)
        Pixel(x, y).hard = _COPYIMAGE(Pixel(x, y).soft, 33)
        Pixel(x, y).ox = x
        Pixel(x, y).oy = y

        _DEST 0 '                                        temporarily print values to figure
        PRINT x, y, Pixel(x, y).soft, Pixel(x, y).hard '  out why this crashes

    NEXT x
NEXT y


Attached Files Image(s)
   
New to QB64pe? Visit the QB64 tutorial to get started.
QB64 Tutorial
Reply


Messages In This Thread
Why does this crash? - by TerryRitchie - 09-18-2023, 09:43 PM
RE: Why does this crash? - by GareBear - 09-18-2023, 10:01 PM
RE: Why does this crash? - by Dav - 09-18-2023, 10:08 PM
RE: Why does this crash? - by TerryRitchie - 09-18-2023, 10:33 PM
RE: Why does this crash? - by TerryRitchie - 09-18-2023, 10:42 PM
RE: Why does this crash? - by TerryRitchie - 09-18-2023, 10:50 PM
RE: Why does this crash? - by mnrvovrfc - 09-18-2023, 11:01 PM
RE: Why does this crash? - by Dav - 09-18-2023, 11:04 PM
RE: Why does this crash? - by mnrvovrfc - 09-18-2023, 11:12 PM
RE: Why does this crash? - by DSMan195276 - 09-19-2023, 12:22 AM
RE: Why does this crash? - by SMcNeill - 09-19-2023, 12:42 AM
RE: Why does this crash? - by bplus - 09-19-2023, 12:43 AM
RE: Why does this crash? - by DSMan195276 - 09-19-2023, 12:47 AM
RE: Why does this crash? - by SMcNeill - 09-19-2023, 12:56 AM
RE: Why does this crash? - by SMcNeill - 09-19-2023, 12:53 AM
RE: Why does this crash? - by DSMan195276 - 09-19-2023, 02:23 AM
RE: Why does this crash? - by TerryRitchie - 09-19-2023, 03:22 AM
RE: Why does this crash? - by bplus - 09-20-2023, 10:09 AM
RE: Why does this crash? - by TerryRitchie - 09-20-2023, 02:21 PM
RE: Why does this crash? - by TerryRitchie - 09-20-2023, 02:44 AM
RE: Why does this crash? - by bplus - 09-20-2023, 02:37 PM
RE: Why does this crash? - by TerryRitchie - 09-20-2023, 05:17 PM



Users browsing this thread: 1 Guest(s)