Per utilizzare la classe devi:
- copiarla nella cartella bin del tuo sito;
- aggiungere un riferimento alla dll dal menu website > add reference di visual studio.
Ecco il codice di una pagina funzionante appena testata:
codice:
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="ISO-8859-1" %>
<%@ Import Namespace="ArtLabs.Pictures" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Dim x As ArtLabs.Pictures.Engine
x = new ArtLabs.Pictures.engine
x.ResizeToFile(Server.MapPath("images/foto.jpg"), Server.MapPath("images/foto2.jpg"), New System.Drawing.Size(300, 300), System.Drawing.Imaging.ImageFormat.Jpeg, True, 100)
x.Dispose()
x = Nothing
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>ImageResize</title>
</head>
<body>
<div>
Fatto!
</div>
</body>
</html>