I need to control if the user insert a 16x16 bitmap .
How I can to control it ?
FUNCTION MAIN()
LOCAL oDlg, oBtn, oGrp, aGet[3]
LOCAL cTabCodice := SPACE(10)
LOCAL cTabDesc := SPACE(10)
LOCAL cTabImage := SPACE(10)
LOCAL oBmp
c_path := CURDRIVE() + ":\" + GETCURDIR()
cImgname := c_path + "\Bitmaps\Help.bmp"
cWidth := "16"
cHeight := "16"
DEFINE DIALOG oDlg FROM 100, 100 TO 258,808;
TITLE "MODIFY" PIXEL
@ 0, 4 GROUP oGrp TO 56, 350 OF oDlg PIXEL
@ 12, 10 SAY "Codice:" OF oDlg SIZE 24, 8 PIXEL
@ 10, 39 GET aGet[1] var cTabCodice OF oDlg SIZE 25, 12 PIXEL READONLY
@ 26, 10 SAY "Descri:" OF oDlg SIZE 22, 8 PIXEL
@ 24, 39 GET aGet[2] var cTabDesc OF oDlg SIZE 305, 12 PIXEL
@ 40, 10 SAY "Image:" OF oDlg SIZE 21, 8 PIXEL
@ 38, 39 GET aGet[3] var cTabImage OF oDlg SIZE 205, 12 PIXEL
@ 36, 250 BTNBMP oBtnSel OF oDlg 2007 ;
FILE cImgName ;
SIZE 18, 18 ;
ACTION ( cFilter := "ALL (*.*)| *.*|" + ;
"JPG (*.jpg)|*.jpg|" + ;
"BMP (*.bmp)|*.bmp|" + ;
"RLE (*.rle)| *.rle|", ;
cImgName := cGetFile32( cFilter,"Select a Picture",,"\" + CurDir() ), ;
IMG_SIZE(cImgName), ;
IIF( empty( cImgName ), MsgAlert( "No file selected !","ATTENTION" ), NIL ), ;
cIMAGE := cFileNoPath( cImgName ), ;
cSUBDIR := cFileSubDir( cImgName ), ;
cTabImage := cImage, aGet[3]:Refresh(), ;
oBtnSel:SetFile( cImgName ) )
oBtnSel:lTransparent := .T.
oBtnSel:cToolTip = { "Width : " + cWidth + CRLF + "Height : " + cHeight, "Bmp-size", 1, CLR_BLACK, 14089979 }
@ 60, 160 BUTTON oBtn PROMPT "&Conferma" OF oDlg SIZE 42, 14 PIXEL DEFAULT ACTION ( oDlg:end( IDOK ) )
@ 60, 211 BUTTON oBtn PROMPT "An&nulla" OF oDlg SIZE 42, 14 PIXEL CANCEL ACTION ( oDlg:end( IDCANCEL ) )
ACTIVATE DIALOG oDlg
RETURN( NIL )
// ------------------
FUNCTION IMG_SIZE(cImgName)
LOCAL oImage
DEFINE IMAGE oImage FILENAME cImgname
cWidth := ALLTRIM(STR(oImage:nWidth()))
cHeight := ALLTRIM(STR(oImage:nHeight()))
oImage:End()
RETURN NIL
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 42 guests