HMG_GetImageInfo

HMG Samples and Enhancements

Moderator: Rathinagiri

Post Reply
User avatar
esgici
Posts: 4513
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 389 times
Been thanked: 111 times
Contact:

HMG_GetImageInfo

Post by esgici » Mon Aug 11, 2014 2:15 pm

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
Has thanked: 1 time
Been thanked: 2 times

Post by Javier Tovar » Mon Aug 11, 2014 3:08 pm

Tranks Sr. Esgici! :)

Regards

User avatar
bpd2000
Posts: 1077
Joined: Sat Sep 10, 2011 4:07 am
Location: India
Has thanked: 197 times
Been thanked: 96 times

Post by bpd2000 » Mon Aug 11, 2014 4:33 pm

Javier Tovar wrote:Tranks Sr. Esgici! :)

Regards
+1
BPD
Convert Dream into Reality through HMG

Post Reply