crmanish
asked on
Image Size in ASP.NET VB
I am using this code to show Image File Size and Dimension information.
<%@ Page Language="VB" aspcompat="true" ContentType="text/html" ResponseEncoding="iso-8859 -1" %>
<%@ Register TagPrefix="MM" Namespace="DreamweaverCtrl s" Assembly="DreamweaverCtrls ,version=1 .0.0.0,pub licKeyToke n=836f606e de05d46a,c ulture=neu tral" %>
<MM:DataSet
id="PI_SML_Image"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%# System.Configuration.Confi gurationSe ttings.App Settings(" MM_CONNECT ION_STRING _connfujit su") %>'
DatabaseType='<%# System.Configuration.Confi gurationSe ttings.App Settings(" MM_CONNECT ION_DATABA SETYPE_con nfujitsu") %>'
CommandText='<%# "SELECT * FROM dbo.Product_Images WHERE PI_ID = 11" %>'
Debug="true"
></MM:DataSet>
<MM:PageBind runat="server" PostBackBind="true" />
<script runat="server">
Sub Page_Load(Src As Object, E As EventArgs)
Dim info
info = Server.CreateObject("Unite dBinary.Au toImageInf o")
info.ReadHeader("C:\Inetpu b\wwwroot\ fujitsu\im ages\produ ctimages\1 300LT-view G1-LT.jpg" )
Format.Text = info.ImageFileFormat
FileSize.Text = info.FileSize
PixelWidth.Text = info.ImageWidth
PixelHeight.Text = info.ImageHeight
End Sub
</script>
<HTML>
<HEAD>
</HEAD>
<BODY>
<asp:Label ID="Format" runat="server"></asp:Label ><br>
<asp:Label ID="FileSize" runat="server"></asp:Label > <br>
<asp:Label ID="PixelWidth" runat="server"></asp:Label > <br>
<asp:Label ID="PixelHeight" runat="server"></asp:Label >
</BODY>
</HTML>
I am working in Dreamweaver MX 2004 and server technology is ASP.NET VB
In the above code i am not able to use a dataset item in info.ReadHeader("C:\Inetpu b\wwwroot\ fujitsu\im ages\produ ctimages\1 300LT-view G1-LT.jpg" ). Dataset is called PI_SML_Image which contains File_Name information.
Please note: UnitedBinary.AutoImageInfo is a com component that I installed in my computer and it is particularly to show image file size in asp.net pages.
I need to show file size and pixel dimensions of an image whose file_name is in the database and image resides in the folder. I have checked quite a few tutorials online which explains how to get that info using server.MapPath but that shows the images of entire directory. I just need to show info on one image whose file_name is in a table of a sql database and it filters the table on the basis of a Request.QueryString("PI_ID ").
I am not really tied up with using the above code so anything totally different is acceptable as long as it works in asp.net vb.
I am using this website for the first time so dont know about the service but hoping to get a solution.
Please help...
Thanks
Manish
<%@ Page Language="VB" aspcompat="true" ContentType="text/html" ResponseEncoding="iso-8859
<%@ Register TagPrefix="MM" Namespace="DreamweaverCtrl
<MM:DataSet
id="PI_SML_Image"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%# System.Configuration.Confi
DatabaseType='<%# System.Configuration.Confi
CommandText='<%# "SELECT * FROM dbo.Product_Images WHERE PI_ID = 11" %>'
Debug="true"
></MM:DataSet>
<MM:PageBind runat="server" PostBackBind="true" />
<script runat="server">
Sub Page_Load(Src As Object, E As EventArgs)
Dim info
info = Server.CreateObject("Unite
info.ReadHeader("C:\Inetpu
Format.Text = info.ImageFileFormat
FileSize.Text = info.FileSize
PixelWidth.Text = info.ImageWidth
PixelHeight.Text = info.ImageHeight
End Sub
</script>
<HTML>
<HEAD>
</HEAD>
<BODY>
<asp:Label ID="Format" runat="server"></asp:Label
<asp:Label ID="FileSize" runat="server"></asp:Label
<asp:Label ID="PixelWidth" runat="server"></asp:Label
<asp:Label ID="PixelHeight" runat="server"></asp:Label
</BODY>
</HTML>
I am working in Dreamweaver MX 2004 and server technology is ASP.NET VB
In the above code i am not able to use a dataset item in info.ReadHeader("C:\Inetpu
Please note: UnitedBinary.AutoImageInfo
I need to show file size and pixel dimensions of an image whose file_name is in the database and image resides in the folder. I have checked quite a few tutorials online which explains how to get that info using server.MapPath but that shows the images of entire directory. I just need to show info on one image whose file_name is in a table of a sql database and it filters the table on the basis of a Request.QueryString("PI_ID
I am not really tied up with using the above code so anything totally different is acceptable as long as it works in asp.net vb.
I am using this website for the first time so dont know about the service but hoping to get a solution.
Please help...
Thanks
Manish
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.