I'm using BlueGUI, and I'm having problems with one part of my program.
I have a subroutine which SHOULD create a new window, add a panel to the window, and put an image on the panel. Instead, it creates a window, but doesn't show an image or panel or anything... Here's my code:
new_image:
image_filename=getGadgetText(edit_image)
if file exist(image_filename)=0 then errorMessage "Image doesn't exist.":return
array insert at bottom image_windows(0)
num_windows=num_windows+1
load bitmap image_filename,num_windows
set current bitmap num_windows
get image num_windows,0,0,bitmap width(num_windows),bitmap height(num_windows)
set current bitmap 0
image_windows(num_windows).image_filename=image_filename
image_windows(num_windows).window_handle=createWindow(100,100,bitmap width(num_windows)+100,bitmap height(num_windows),image_filename,WINDOW_FIXED,WINDOW_TOOLWINDOW,1,0)
image_windows(num_windows).panel_image=createPanel(0,0,bitmap width(num_windows),bitmap height(num_windows),image_windows(num_windows).window_handle)
setPanelBorderStyle image_windows(num_windows).panel_image,BORDER_FLAT
setPanelImage image_windows(num_windows).panel_image,num_windows
bringToFront panel_image
paintGadget image_windows(num_windows).panel_image
return
edit_image is a Edit where I have them input the filename, and image_windows is an array of type imagewindow
type imagewindow
image_filename as string
window_handle as integer
panel_image as integer
endtype
This code works if I replace:
setPanelImage image_windows(num_windows).panel_image,num_windows
with:
setPanelImage image_windows(num_windows).panel_image,image_filename
However, this only allows bitmaps, whereas DBPro supports TGA,DDS,JPG,etc...
btw, num_windows is a variable which increases every time I open a new window, so I use it to determine which image, bitmap, array index, etc. to use...
thanks in advance