December 03, 2020, 08:44:58 PM

Author Topic: [bb] Check if an image have good size by Filax [ 1+ years ago ]  (Read 468 times)

Offline BlitzBot

  • Jr. Member
  • **
  • Posts: 1
Title : Check if an image have good size
Author : Filax
Posted : 1+ years ago

Description : Test if an image have good size

Code :
Code: BlitzBasic
  1. If Proc_GetImageSize("C:TmpTest.bmp",512,512) Then
  2. ; Good
  3. Else
  4. ; Bad
  5. endif
  6.  
  7.  
  8. Function Proc_GetImageSize(Filename$,SizeX,SizeY)
  9.         If FileType(Filename$)=1 Then
  10.                 Tmp_Image=LoadImage(Filename$)
  11.  
  12.                 If ImageWidth(Tmp_Image)<>SizeX And ImageHeight(Tmp_Image)<>SizeY Then
  13.                         FreeImage Tmp_Image
  14.                         Return False
  15.                 Else
  16.                         FreeImage Tmp_Image
  17.                         Return True
  18.                 EndIf
  19.         Else
  20.                 Return False
  21.         EndIf
  22. End Function


Comments :


Agamer(Posted 1+ years ago)

 I could see this being useful but you might want to exsplain what good size acturly means as I thought It ment file size but it acturly means dimensions.Very simple but it is useful!Could be used to make sure when pepole alter the images to your game that they will still look right as it will only show if it is the right dimensions!Thanks.


Filax(Posted 1+ years ago)

 Nothing :)


 

SimplePortal 2.3.6 © 2008-2014, SimplePortal