Ask Experts Questions for FREE Help !
Ask
    rrr's Avatar
    rrr Posts: 91, Reputation: 1
    Junior Member
     
    #1

    Jan 3, 2007, 06:48 AM
    Liberty basic "drawbmp" command is acting up
    I use xp home edition and have liberty basic v.4.03
    The code goes like folowing:

    Loadbmp "bmpname", "bmppath"
    Graphicbox #window.graphicbox, 5, 5, 447, 511
    Open "window" for dialog_popup as #window
    Print #window.graphicbox "drawbmp bmpname 0 0" <-- error in this line
    Wait

    I have dimesioned the window and trapped the close event but the liberty basic says "no bitmap named bmpname. I have checked the path, and it is correct. What the!! Is going on?

    :confused:
    LTheobald's Avatar
    LTheobald Posts: 1,051, Reputation: 127
    Ultra Member
     
    #2

    Jan 3, 2007, 07:32 AM
    Hey RRR,

    I've not touched Basic before but I'll give this shot. What kind of path are you putting in the loadbmp line? It should be fully qualified, e.g:

    Code:
    loadbmp "copyimage", "bmp\copy.bmp"
    Or
    Code:
    loadbmp "copyimage", "C:\bmp\copy.bmp"
    The code you supplied says "bmpath" which won't be valid.
    rrr's Avatar
    rrr Posts: 91, Reputation: 1
    Junior Member
     
    #3

    Jan 3, 2007, 07:36 AM
    sorry for that syntax error I mean to type
    loadbmp "bmpname", path$
    (the $ sign makes it a string variable if you didn't know)
    where path$ is "C:\Documents and Settings\username\my documents\bmps\abmpfile.bmp"
    rrr's Avatar
    rrr Posts: 91, Reputation: 1
    Junior Member
     
    #4

    Jan 3, 2007, 07:42 AM
    Here is the actual code used. The purpose of this program was to show all th bmpfiles in a directory like a slideshow. Yes, I know, I could have used some other solution, BUT, I need to know what went wrong. :confused:

    Code:
    cinematic$="cinematic 1"
    'nomainwin
    dim arrayName$(40, 40)
    files DefaultDir$+"\"+cinematic$, arrayName$()
    times=val(arrayName$(0, 0))
    num=times
    maxnum=num
    
    [loadmoviebmp]
    while times > 0
    if right$(arrayName$(times, 0), 3) = "bmp" then
    loadbmp  DefaultDir$+"\"+cinematic$+"\"+arrayName$(times, 0), DefaultDir$+"\"+cinematic$+"\"+arrayName$(times, 0)
    end if
    num=num-1
    times=times-1
    wend
    maxnum=num
    
        WindowWidth = 526
        WindowHeight = 514
        UpperLeftX=int((DisplayWidth-WindowWidth)/2)
        UpperLeftY=int((DisplayHeight-WindowHeight)/2)
        graphicbox #cin.dis,   5, 5, 511, 477
        open "game cinematic" for dialog_popup as #cin
        print #cin.dis, "down; fill white; flush"
        print #cin, "font ms_sans_serif 10"
        print #cin, "trapclose [unloadmovie]"
        print #cin.dis, "color black ; place 10 45 ; font arial 40"
        print #cin.dis, "\Right-click to "
        #cin.dis, "place 10 100"
        #cin.dis, "\continue"
        #cin.dis, "when leftButtonDown [movieinput]"
    
    
    
    num=maxnum
        wait
    
    
    [movieinput]
    print str$(num)
    if right$(arrayName$(num, 0), 3) = "bmp" and num <> 8 then
    print DefaultDir$+"\"+cinematic$+"\" ; arrayName$(times, 0)
    print #cin.dis, "drawbmp " ; DefaultDir$+"\"+cinematic$+"\" ; arrayName$(times, 0) ; ".bmp 11 11"
    else
    num=num+1
    end if
    wait
    
    
    [unloadmovie]
    num=0
    while num > val(arrayName$(0, 0))
    if right$(arrayName$(num, 0), 3) = "bmp" then
    unloadbmp str$(num)
    end if
    num=num+1
    wend
    Carl Gundel's Avatar
    Carl Gundel Posts: 2, Reputation: 2
    New Member
     
    #5

    Jan 11, 2007, 02:18 PM
    Hi,

    The trouble seems to be that you have a space in the pathname. Parsing for the graphics commands delimits by spaces so the drawbmp command is looking for a bitmap named:

    C:\Documents

    Try making a folder without spaces (perhaps c:\myimages) and put the images in there.

    -Carl Gundel, author of Liberty BASIC
    Liberty BASIC - Easy Programming for Windows
    rrr's Avatar
    rrr Posts: 91, Reputation: 1
    Junior Member
     
    #6

    Jan 15, 2007, 04:04 AM
    Aha. Thank you *bows and slaps own face*

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Fan Blower not working in "ON" or "AUTO" in heat or AC [ 13 Answers ]

Got home from the Brewer game this afternoon and noticed the house was warm(78). Outside was 91. I checked the T-stat and it was set correct. Noticed the air vents weren't blowing anything. Went outside and the condenser and fan was running fine. Then I went downstairs to the furnace unit to see...

Pink pill with "watson" and "502" on it [ 2 Answers ]

What kind of pill is pink and has watson 502 on it?

Heater blows cold when "On", not at all on "Auto" [ 1 Answers ]

Our gas heater is 7 years old, and has worked fine in the two years we've rented here. This winter though, we can't get it to work consistently. When on "Auto", it doesn't turn on at all, no matter what temperature we select, and when we turn the fan to "On", it simply blows cold air. It...

Difference between "htm" and "html" [ 3 Answers ]

Hello, In all the websites I make, they all come out when loaded onto the server as a "htm" file. But I see others who have "html" files on their sites, what exactly is the difference, if any? For example: what is the difference between index.htm and index.html and will the nameservers...


View more questions Search