At Ask Me Help Desk you can ask questions in any topic and have them
answered for free by our experts. To ask questions or participate in
answering them you must register for a free account. By registering you
will be able to:
Get free answers from experts in any of our 300+
topics.
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?
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"
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.
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
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.