1. Win32Lib Pixmaps error

Hello David, anyone...

I am writing a program to display some bitmap images by transBlt()ing
them on top of each other. I am using Pixmaps to store the images so
I can just blit a few at a time. I got it working one time but I
changed some stuff and now I get this error:

<path>\Win32lib.ew:9730 in procedure SetPixmap ()
subscript value 0 is out of bounds reading a sequence of length 20
....

I had to type that in manually but I'm sure the line number and
error is correct. Do you know what kind of bad data I am passing
to setPixmap that causes it to have this error. I printed out my
path and filename with wPuts () and it looks okay but I am creating
it at runtime within a loop. I'm sure the file it fails on is there
but when I print it out, there is a vertical slash thru the '2'.
Does anyone have any ideas?

later,
Lewis Townsend

________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

new topic     » topic index » view message » categorize

2. Re: Win32Lib Pixmaps error

On Sat, 15 Jul 2000 16:30:00 GMT, Lewis Townsend wrote:

>Hello David, anyone...
>
>I am writing a program to display some bitmap images by transBlt()ing
>them on top of each other. I am using Pixmaps to store the images so
>I can just blit a few at a time. I got it working one time but I
>changed some stuff and now I get this error:
>
><path>\Win32lib.ew:9730 in procedure SetPixmap ()
>subscript value 0 is out of bounds reading a sequence of length 20
>....
>
>I had to type that in manually but I'm sure the line number and
>error is correct. Do you know what kind of bad data I am passing
>to setPixmap that causes it to have this error. I printed out my
>path and filename with wPuts () and it looks okay but I am creating
>it at runtime within a loop. I'm sure the file it fails on is there
>but when I print it out, there is a vertical slash thru the '2'.
>Does anyone have any ideas?

If you still haven't figured this out, I'd be happy to help.  I would need
to know what version of Win32lib you are using and maybe the contents of
your ex.err (for more info).  If you don't mind sharing your code I could
probably figure it out even faster.

-- Brian

new topic     » goto parent     » topic index » view message » categorize

3. Re: Win32Lib Pixmaps error

Hello Brian,

Sorry for the late reply. I haven't figured it out yet. It's a
little hard for me to access my files from this computer because
it's my brother's and his password has expired on my computer.
It would also be a hard to copy it all on disk because of the
number of bitmap files (there's lots) but if I don't figure it
out soon I'll send you the ex.err. I tried writing a smaller demo
that did the same thing but with fewer images but it didn't have
the same problem, so I assume it's just a silly error on my part.
I DID figure out what was cuasing the vertical slash in the '2'.
It was because it was printing over a '1' in the same place. This
means that it got to the 2nd iteration of my "for" loop before
crashing but I swear the exact same file loaded and displayed when
I was using fewer images. Is there a LIMIT to the number of pixmaps
I can have in a program? I think I created 352.

>If you still haven't figured this out, I'd be happy to help.  I would need
>to know what version of Win32lib you are using and maybe the contents of
>your ex.err (for more info).  If you don't mind sharing your code I could
>probably figure it out even faster.
>
>-- Brian

Thanks for your offer,
Lewis Townsend
.     __       _____  __    __    __    __    _____
.    /\ \     /\    \|\ \  /\ \  /\ \  /\ \  /\    \
.   /  \_\   /  \____\ \_\/  \_\/  \_\/  \_\/  \____\
.  /   / /  /   / ___/ |  |  / |   / /   / /\  /  __ \
. /   / /  /   / /_\ | |  | /  |  / /   / /\_\/  /_ \/
./   / /\ /   / ___/ | |  |/   | / /   / /\ \ \__  \
.\  / /__\\  / /__\  \ |    /| |/ /\  / /  \/\_\/  /
. \/_____/ \/_____/   \|___/\|___/  \/_/    \_____/
keroltarr at hotmail.com  http://geocities.com/keroltarr/
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

new topic     » goto parent     » topic index » view message » categorize

4. Re: Win32Lib Pixmaps error

Lewis Townsend wrote:

> Is there a LIMIT to the number of pixmaps
> I can have in a program? I think I created 352.

Keep in mind that a pixmap is just a plain old windows bitmap by another
name. You might run Resource Meter (Start|Program|Acessories|System Tools)
to see if it's eating up all the GDI resources.

If a lot of the bitmaps are the same size, you can merge them together into
a graphics editor and load them at once, and then used BitBlt to select only
the portion of the bitmap you are interested in. That's how most programs
handle animated sprites, for example.

-- David Cuny

new topic     » goto parent     » topic index » view message » categorize

5. Re: Win32Lib Pixmaps error

Hello,

>Lewis Townsend wrote:
>
> > Is there a LIMIT to the number of pixmaps
> > I can have in a program? I think I created 352.

I reduced that number to 96 but I think it's choking up on
the 4th one.


>Keep in mind that a pixmap is just a plain old windows bitmap by another
>name. You might run Resource Meter (Start|Program|Acessories|System Tools)
>to see if it's eating up all the GDI resources.

I have 128 Mb RAM and it the error happens very quickly...
no grunting of the hard-drive and such.

>If a lot of the bitmaps are the same size, you can merge them together into
>a graphics editor and load them at once, and then used BitBlt to select
>only
>the portion of the bitmap you are interested in. That's how most programs
>handle animated sprites, for example.
>
>-- David Cuny

Yeah, they're all the same size and I plan on merging them when I have
everything they way I want but for now I just want to see how they
look together.

Here is the EX.ERR message if anyone still wants to see it.

later,
Lewis Townsend
.     __       _____  __    __    __    __    _____
.    /\ \     /\    \|\ \  /\ \  /\ \  /\ \  /\    \
.   /  \_\   /  \____\ \_\/  \_\/  \_\/  \_\/  \____\
.  /   / /  /   / ___/ |  |  / |   / /   / /\  /  __ \
. /   / /  /   / /_\ | |  | /  |  / /   / /\_\/  /_ \/
./   / /\ /   / ___/ | |  |/   | / /   / /\ \ \__  \
.\  / /__\\  / /__\  \ |    /| |/ /\  / /  \/\_\/  /
. \/_____/ \/_____/   \|___/\|___/  \/_/    \_____/
keroltarr at hotmail.com  http://geocities.com/keroltarr/


C:\EUPHORIA\LEWIS\Karitaren\Graphics\win32lib.ew:9730 in procedure
setPixmap()
subscript value 0 is out of bounds, reading from a sequence of length 12
    id = 0
    bitmap = {67'C',58':',92'\',69'E',85'U',80'P',72'H',79'O',82'R',73'I',

... called from C:\EUPHORIA\LEWIS\Karitaren\Graphics\TEST.EXW:73 in
procedure Dress()
    i = 2

... called from C:\EUPHORIA\LEWIS\Karitaren\Graphics\win32lib.ew:12079 in
function wmCommand()
    hWnd = 2752838
    iMsg = 273
    wParam = 0
    lParam = 1114326
    ok = 0
    id = <no value>
    event = 0
    action = 3
    control = 7
    mouseX = <no value>
    mouseY = <no value>
    parms = {}

... called from C:\EUPHORIA\LEWIS\Karitaren\Graphics\win32lib.ew:12323 in
function WndProc()
    hWnd = 2752838
    iMsg = 273
    wParam = 0
    lParam = 1114326
    id = 3
    action = <no value>
    mouseX = <no value>
    mouseY = <no value>
    cx = <no value>
    cy = <no value>
    at = <no value>
    hdc = <no value>
    rect = <no value>
    ps = <no value>
    parms = <no value>
    result = <no value>

^^^ call-back from Windows

... called from C:\EUPHORIA\LEWIS\Karitaren\Graphics\win32lib.ew:12805 in
function SubProc()
    hWnd = 1114326
    iMsg = 514
    wParam = 0
    lParam = 393345
    id = 7
    pointer = <no value>
    tabKey = <no value>
    x = 129
    y = 6
    parent = <no value>
    result = 0

^^^ call-back from Windows

... called from C:\EUPHORIA\LEWIS\Karitaren\Graphics\win32lib.ew:12968 in
procedure WinMain()
    id = 3
    style = 0
    hWnd = <no value>
    msg = 9318880

... called from C:\EUPHORIA\LEWIS\Karitaren\Graphics\TEST.EXW:136

Global & Local Variables

C:\EUPHORIA\include\machine.e:
    check_calls = 1

C:\EUPHORIA\include\msgbox.e:
    lib = 2011234304
    msgbox_id = 0
    get_active_id = 1

C:\EUPHORIA\include\file.e:
    SLASH = 92'\'
    my_dir = -2

C:\EUPHORIA\include\get.e:
    input_file = <no value>
    input_string = <no value>
    string_next = <no value>
    ch = <no value>

C:\EUPHORIA\LEWIS\Karitaren\Graphics\win32lib.ew:
    ok = 0
    user32 = 2011234304
    gdi32 = 2012479488
    winmm = 2002190336
    comdlg32 = 1991442432
    comctl32 = 2008350720
    kernel32 = 2011693056
    shell32 = 2002386944
    xCleanUp = 2
    showWarnings = 1
    strings = {}
    allottedSize = 0
    classes = 37'%'
    Screen = 1
    Printer = 2
    className = {0,{98'b',117'u',116't',116't',111'o',110'n'},{98'b',117'u',
51'3',50'2'},0,0,0}
    classType = {0,1,1,1,1,1,1,4,4,2,2,2,2,3,3,6,6,6,5,5,6,6,7,8,9,10,
11,11,1,1,1,11,11,11,0,0,0}
    classStyle = {0,1342242816,1342242817,1342242819,1342242822,1342242825,
    classStyleEx = {0,0,0,0,0,0,0,528,528,512,512,512,512,528,528,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
    WndProcAddress = 9199016
    SubProcAddress = 9199120
    onMouse = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}
    onClick = {-1,-1,-1,-1,-1,-1,3,-1,-1,-1,-1,-1}
    onKeyPress = {-1,-1,5,-1,-1,-1,-1,-1,-1,-1,-1,-1}
    onKeyUp = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}
    onKeyDown = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}
    onResize = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}
    onChange = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}
    onGotFocus = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}
    onLostFocus = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}
    onScroll = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}
    onOpen = {-1,-1,4,-1,-1,-1,-1,-1,-1,-1,-1,-1}
    onClose = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}
    onDestroy = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}
    onTimer = {-1,-1,6,-1,-1,-1,-1,-1,-1,-1,-1,-1}
    onPaint = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}
    onDragAndDrop = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}
    onEvent = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}
    mainWindow = 3
    modalWindow = 0
    modalStack = {}
    paintDC = {}
    myId = {3,3,3,3,3,7}
    myReturn = {0,0,0,0,0,0}
    window_handle =
503644847,3037004485,2131034789,2735014581}
    window_func = {-1,-1,-1,2011388122,2011388122,2011388122,2011268897,
-1,-1,-1,-1,-1}
    window_class = {-1,-1,0,2,2,2,1,10,10,10,10,10}
    window_type = {36'$',37'%',1,13,13,13,3,26,26,26,26,26}
    window_focus_order = {{},{},{4,5,6,7},{},{},{},{},{},{},{},{},{}}
    window_focus = {0,0,7,0,0,0,0,0,0,0,0,0}
    window_owner = {0,0,0,3,3,3,3,0,0,0,0,0}
    window_menu = {0,0,0,0,0,0,0,0,0,0,0,0}
    window_toolbar = {0,0,0,0,0,0,0,0,0,0,0,0}
    window_statusbar = {0,0,0,0,0,0,0,0,0,0,0,0}
    window_tooltip = {{},{},{},{},{},{},{},{},{},{},{},{}}
    window_font = {{{},0,0,0},{{},0,0,0},{{},0,0,0},{{},0,0,0},{{},0,0,
{{},0,0,0}}
    window_fcolor = {0,0,0,0,0,0,0,0,0,0,0,0}
    window_bcolor = {13160660,13160660,13160660,13160660,13160660,13160660,
    window_pen = {{0,0,0,13,1,1},{0,0,0,13,1,1},{0,65280,0,13,1,1},{0,
    window_x = {0,0,0,0,0,0,0,0,0,0,0,0}
    window_y = {0,0,0,0,0,0,0,0,0,0,0,0}
    window_scroll = {{1,10},{1,10},{1,10},{1,10},{1,10},{1,10},{1,10},
{1,10},{1,10},{1,10},{1,10},{1,10}}
    window_range = {{1,10},{1,10},{1,10},{1,10},{1,10},{1,10},{1,10},{1,
10},{1,10},{1,10},{1,10},{1,10},{0,100'd'}}
    window_tabitems = {{},{},{},{},{},{},{},{},{},{},{},{}}
    window_group = {{},{},{},{},{},{},{},{},{},{},{},{}}
    window_cursor = {0,0,0,0,0,0,0,0,0,0,0,0}
    window_hotkeys = {{},{},{{13,7}},{},{},{},{},{},{},{},{},{}}
    window_textalign = {0,0,0,0,0,0,0,0,0,0,0,0}
    tooltipControl = 0
    tooltipWindow = 0
    tooltipState = 0
    tooltipMouseX = -1
    tooltipMouseY = -1
    tooltipX = 0
    tooltipY = 0
    tooltipShow = 1
    tooltipCovers = 0
    transColor = 16711935
    heldResource = {{2969895609,8,1},{503644847,9,1},{3037004485,3,1},
{2131034789,3,1},{2735014581,3,1}}
    heldCursor = {}
    printerDC = 0
    grabbedHDC = {}
    regCount = 1
    customColors = 8977776
    i = 63'?'
    hintFontSize = 8
    hintFontAttrib = 0
    hintFontName = {77'M',83'S',32' ',83'S',97'a',110'n',115's',32' ',
83'S',101'e',114'r',105'i',102'f'}
    xpmErrFlag = <no value>
    transTuple = {255,0,255}

C:\EUPHORIA\LEWIS\Karitaren\Graphics\loop.e:
    classes = {}
    properties = {}
    procedures = {}
    functions = {}
    objects = {}
    TypeCheck = 1

C:\EUPHORIA\LEWIS\Karitaren\Graphics\TEST.EXW:
    progress = 3
    Dir = 1
    x = 100'd'
    y = 100'd'
    temp = <no value>
    heads = {10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0}
    torsos = {11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0}
    legses = {12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0}
    head = 5
    torso = 5
    legs = 4
    first = 0





________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

new topic     » goto parent     » topic index » view message » categorize

6. Re: Win32Lib Pixmaps error

> From:  Lewis Townsend

<SNIP>

> C:\EUPHORIA\LEWIS\Karitaren\Graphics\win32lib.ew:9730 in procedure
> setPixmap()
> subscript value 0 is out of bounds, reading from a sequence
> of length 12
>     id = 0

<SNIP>

It looks like your procedure Dress() is passing a zero as its first param to
setPixMap(), which is id in setPixmap().  Win32lib uses id as a subscript to
find the handle of the pixmap (within the sequence window_handle), hence the
subscript error.  Looks like the bug is coming from somewhere in your code.
Probably just a typo somewhere.

Matt Lewis

new topic     » goto parent     » topic index » view message » categorize

7. Re: Win32Lib Pixmaps error

Hello Matt, Brian,

>It looks like your procedure Dress() is passing a zero as its first param
>to
>setPixMap(), which is id in setPixmap().  Win32lib uses id as a subscript
>to
>find the handle of the pixmap (within the sequence window_handle), hence
>the
>subscript error.  Looks like the bug is coming from somewhere in your code.
>Probably just a typo somewhere.
>
>Matt Lewis

Thanks, yes, it was passing a zero. No, it wasn't a typo but
a blatant logic error. Here's the gist of it if any are
interested:

sequence s
for i = 1 to 32 do
  if first_iteration then
    s = repeat (0, 32)
    s [i] = create(pixmap) -- obviously only the first pixmap is set
  end if
  setPixmap (s[i])
end for

should have been:

sequence s
for i = 1 to 32 do
  if first_iteration then
    s = repeat (0, 32)
  end if
  s [i] = create(pixmap) -- obviously only the first pixmap is set
  setPixmap (s[i])
end for

OR

sequence s
s = repeat (0, 32)
for i = 1 to 32 do
  s [i] = create(pixmap) -- obviously only the first pixmap is set
  setPixmap (s[i])
end for

There was a reason for putting the initialization in the for-loop
just not a very good one. Thanks again for all the help.

later,
Lewis Townsend
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu