Page 1 of 1

HMG_GetImageInfo

Posted: Mon Aug 11, 2014 2:15 pm
by esgici
Function : HMG_GetImageInfo() : Get Information an Image

Syntax : HMG_GetImageInfo ( [ cFileName | hBitmap ], @nWidth, @nHeight, @aBackColor, [ nRowColor ], [ nColColor ] ) --> return lBoolean

Intruduced with : HMG 3.2 (Stable) 2013/12/08

See first : C:\hmg.3.3.1\SAMPLES\Miscellaneous\ScreenSplash\ScreenSplash.prg

Thanks to Dr. Soto

Code: Select all

/*

   HMG_GetImageInfo()
   Get Information an Image

   HMG_GetImageInfo ( [ cFileName | hBitmap ], @nWidth, @nHeight, @aBackColor, [ nRowColor ], [ nColColor ] ) --> return lBoolean

   Intruduced with : HMG 3.2 (Stable) 2013/12/08   
   
   See first : C:\hmg.3.3.1\SAMPLES\Miscellaneous\ScreenSplash\ScreenSplash.prg
      
   Thanks to Dr. Soto   
      
   
*/
#include <hmg.ch>

PROCEDURE Main()

   LOCAL cMessage := ImageInfoVerbose( "BosTaurus_logo.bmp" )  // be sure that this file exist !

   IF HB_ISNIL( cMessage ) 
      MsgStop( "Couldn't get image info !", "Error !" )
   ELSE
      MsgBox( cMessage, "Image Info" )
   ENDIF
 
RETURN // ImageInfoSample.Main()
 
*-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.

FUNCTION ImageInfoVerbose( cIMageFName )
    
   LOCAL xRVal, nWidth, nHeight, aBackColor 

   IF FILE( cIMageFName ) 
      IF HMG_GetImageInfo ( cIMageFName, @nWidth, @nHeight, @aBackColor ) 

         xRVal := cIMageFName + " image info :" + CRLF + CRLF +;      
                  "Width : " + NTOC( nWidth ) + CRLF +;   
                  "Height : " + NTOC( nHeight ) + CRLF +;   
                  "Back Color : " + HB_ValToExp( aBackColor ) 
      ELSE
         MsgStop( "Couldn't obtained Image Info.", "Error" )         
      ENDIF      
   ELSE
      MsgStop( cIMageFName + " file not found !", "ERROR" )  
   ENDIF

RETURN xRVal // ImageInfoVerbose()

*-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.


Re: HMG_GetImageInfo

Posted: Mon Aug 11, 2014 3:08 pm
by Javier Tovar
Tranks Sr. Esgici! :)

Regards

Re: HMG_GetImageInfo

Posted: Mon Aug 11, 2014 4:33 pm
by bpd2000
Javier Tovar wrote:Tranks Sr. Esgici! :)

Regards
+1