HMG_GetImageInfo

HMG Samples and Enhancements

Moderator: Rathinagiri

Post Reply
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

HMG_GetImageInfo

Post 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()

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

Viva INTERNATIONAL HMG :D
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: HMG_GetImageInfo

Post by Javier Tovar »

Tranks Sr. Esgici! :)

Regards
User avatar
bpd2000
Posts: 1207
Joined: Sat Sep 10, 2011 4:07 am
Location: India

Re: HMG_GetImageInfo

Post by bpd2000 »

Javier Tovar wrote:Tranks Sr. Esgici! :)

Regards
+1
BPD
Convert Dream into Reality through HMG
Post Reply