$INCLUDE "RAPIDQ.INC"
$TYPECHECK ON
$APPTYPE GUI
DECLARE FUNCTION LoadImageFile LIB "JPEG.DLL" ALIAS "LoadImageFile" _
(hWnd AS LONG, file$ AS STRING) AS INTEGER
DECLARE SUB loadpicture
DECLARE SUB selectpicture
CREATE form AS QFORM
width = 400
height = 400
CREATE Image1 AS QIMAGE
AutoSize = 1
onclick = selectpicture
transparent = 0
visible = 0
END CREATE
onclick = selectpicture
END CREATE
form.SHOWMODAL
SUB selectpicture
DIM seldialog AS QOPENDIALOG
seldialog.Filter = "Picture files|*.BMP;*.ICO;*.JPG;*.GIF;*.WMF;*.EMF"
IF seldialog.EXECUTE THEN
image1.handle = LoadImageFile(0,seldialog.filename)
image1.visible = 1
form.width = image1.width + 8
form.height = image1.height + 44
form.CAPTION = seldialog.filename
END IF
END SUB
|