Code archives/File Utilities/Check if an image have good size

This code has been declared by its author to be Public Domain code.

Download source code

Check if an image have good size by Filax2004
Test if an image have good size
If Proc_GetImageSize("C:\Tmp\Test.bmp",512,512) Then 
; Good
Else
; Bad
endif


Function Proc_GetImageSize(Filename$,SizeX,SizeY)
	If FileType(Filename$)=1 Then 
		Tmp_Image=LoadImage(Filename$)

		If ImageWidth(Tmp_Image)<>SizeX And ImageHeight(Tmp_Image)<>SizeY Then
			FreeImage Tmp_Image
			Return False
		Else
			FreeImage Tmp_Image
			Return True
		EndIf
	Else
		Return False
	EndIf 
End Function

Comments

Agamer2004
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.


Filax2004
Nothing :)


Code Archives Forum