Find a piece of code on the Internet, compile it into a component can be used, but also support png<br>
<br>
<br>
' I have released this source code into the public domain. Use it<br>
' With no strings attached.<br>
' Just call getimagesize with a string containing the filename, and<br>
' It'll return a user defined type ' imagesize ' (below) <br>
' Return values of 0 indicate an error of some sort. The error handling<br>
' In this module is limited. There is *no* error handling on the test<br>
' form. This routine was limited to X or Y sizes of 32767 pixels, but that<br>
' should not to be a problem.<br>
<br>
' Check back at http://www.qtm.net/~davidc<br>
' I may add support for the more file types.<br>
<br>
' Supported in this version:<br>
' Jpeg<br>
' Gif<br>
' Png<br>
<br>
' This routine does is not require any royalty fees for Unisys as it<br>
' Does ' compressed part of GIF Files. it simply reads<br>
' 4 bytes to determine image size.<br>
<br>
Option explicit<br>
Public WiMG as Long<br>
Public himg as Long<br>
Public Type imagesize<br>
Width as Long<br>
Height as Long<br>
End Type<br>
<br>
Public Sub getimagesize (sfilename as String) <br>
on Error Resume next ' Your ' ll want to change this<br>
dim IFN as Integer<br>
dim Btemp (3) as byte<br>
dim Lflen as Long<br>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.