Visualizzazione dei risultati da 1 a 8 su 8
  1. #1

    ridimensionare immagine

    Non riesco a capire come settare il link
    codice:
    <% response.write "[img]resize.aspx?src=/images/IMG_BIAS2004.jpg[/img]</A>"
    %>
    non mi fa vedere la foto e il link non c'è !

  2. #2

  3. #3
    no va....!
    vedo la x rossa e non la foto piccola ed il link che passa è foto.asp# e non apre nulla !

    File Resize
    codice:
    <%@ Import Namespace="System.Drawing"%>
    <%@ Import Namespace="System.Drawing.Imaging"%>
    <SCRIPT RUNAT="SERVER">
    Sub Page_Load()
    
      Dim width as Integer = 0
      Dim height as Integer = 0
    
      try
        ' ricava dimensioni dalla richiesta
        if not Request.QueryString("width") is Nothing Then
        width = Int32.Parse(Request.QueryString("width"))
        End if
        if not Request.QueryString("height") is Nothing Then
        height = Int32.Parse(Request.QueryString("height"))
        End if
    
      catch ex as Exception
      End Try
    
      ' ridimensiona l'immagine se specificato
      Dim immagine as String = Server.MapPath(Request("img"))
      if Not System.Io.File.Exists(immagine) then
        immagine = Server.MapPath("/immagini/nondisponibile.jpg")
      end if
     
      call ImgRedim(immagine, width, height)
    
      ' fermo il resto della risposta
      Response.End()
    End Sub
    
    ' Funzione di redim
    Public Sub ImgRedim(immagine as String, width as Integer, height as Integer)
      Dim bmp as System.Drawing.Bitmap = CType(System.Drawing.Image.FromFile(immagine), System.Drawing.Bitmap)
    
      ' c'è da ridimensionare?
      if width>0 or height>0 then
        ' se è specificata solo la larghezza, calcola l'altezza
        if height = 0 Then
        height = Convert.ToInt32(width / bmp.Width * bmp.Height)
        End if
    
        ' (e viceversa)
        if width = 0 Then
        width = Convert.ToInt32(height / bmp.Height * bmp.Width)
        End if
    
        ' creo la Thumbnail con i parametri impostati
        Dim miniaturabmp as New System.Drawing.Bitmap(bmp, width, height)
    
        ' salvo sullo stream di output
        if immagine.EndsWith(".jpg") Then
        miniaturabmp.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg)
        else
        miniaturabmp.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Gif)
        end if
    
        ' pulizia
        miniaturabmp.Dispose()
      else
        ' salvo sullo stream di output
        if immagine.EndsWith(".jpg") Then
        bmp.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg)
        else
        bmp.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Gif)
        end if
      end if
    
      ' pulizia finale
      bmp.Dispose()
    
    End Sub
    
    </SCRIPT>

  4. #4
    dal momento che hai

    Dim immagine as String = Server.MapPath(Request("img"))

    dovrai usare

    <a href="#"><img src='resize.aspx?img=/images/IM.........
    "...non è detto che sia tardi se non guardi che ora è..."

  5. #5
    nulla...scusate ma sono alle prime armi con ASPX !

    vedo la foto ma il link non mi apre nulla !!!!

    [CODE]
    [img]resize.aspx?img=IMG_BIAS2004.jpg&w=103&h=69[/img]click
    [C/ODE]

  6. #6
    Utente di HTML.it L'avatar di pietro09
    Registrato dal
    Jan 2002
    Messaggi
    10,116
    Originariamente inviato da zeweb
    nulla...scusate ma sono alle prime armi con ASPX !

    vedo la foto ma il link non mi apre nulla !!!!

    [CODE]
    [img]resize.aspx?img=IMG_BIAS2004.jpg&w=103&h=69[/img]click
    [C/ODE]
    Scusa, ma che dici? come pretendi di mandare una richiesta al server se non la metti esplicitamente????

    click

    Dove è il codice di richiesta pagina al server?
    Cioè, stai facendo una pagina abbastanza specialistica di manipolazione immagini e chiedi come mai click non faccia assulutamente nulla? :maLOL:
    Pietro

  7. #7
    intendi il mio file ASPX

    <a href="resize.aspx">

  8. #8
    mi da questo :

    1. Add a "Debug=true" directive at the top of the file that generated the error. Example:

    <%@ Page Language="C#" Debug="true" %>

    or:

    2) Add the following section to the configuration file of your application:

    <configuration>
    <system.web>
    <compilation debug="true"/>
    </system.web>
    </configuration>

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.