Visualizzazione dei risultati da 1 a 4 su 4

Discussione: DLL?!?!?!?

  1. #1
    Utente di HTML.it
    Registrato dal
    Jan 2006
    Messaggi
    63

    DLL?!?!?!?

    DLL....?!?!?!?!?!?!?!

    Mi manca un pezzo???

    Allora ho una dll e in questa dll ho trovato un piccolo bug che ho corretto, questa dll la utilizzo come httpHandlers di un'applicazione web...bene, la compilo cerco di testarla ma quella creata ex novo da me non va al contraio quella vecchia funziona, la differenza che noto è solo a livello visivo le icone sono diverse...

    AIUTAMEMIIIIIIIIIIIIIIIIIIII...................... .......... vi prego vi scongiuroooooooooo...

  2. #2
    Utente di HTML.it
    Registrato dal
    Jan 2006
    Messaggi
    63

    insomma

    insomma devo compilare questa dll mi dite come si fa anche se so che .net lo fa in automatico???????????????????????

    Imports System
    Imports System.Web
    'Imports System.IO
    Imports System.Drawing.Imaging
    Imports System.Drawing

    Namespace RiImg
    Public Class ImageHandler
    Implements IHttpHandler

    Public Sub ProcessRequest(Context as HttpContext) Implements IHttpHandler.ProcessRequest

    Dim width as Integer = 0
    Dim height as Integer = 0

    try
    ' ricava dimensioni dalla richiesta
    if not Context.Request.QueryString("width") is Nothing Then
    width = Int32.Parse(context.Request.QueryString("width"))
    End if
    if not context.Request.QueryString("height") is Nothing Then
    height = Int32.Parse(context.Request.QueryString("height"))
    End if

    catch ex as Exception
    ' se ci sono errori nei parametri inviati, mostra l'immagine normale
    End Try

    ' ridimensiona l'immagine se specificato
    Dim immagine as String = Context.Request.PhysicalPath
    call ImgRedim(Context, immagine, width, height)
    ' fermo il resto della risposta
    Context.Response.End()
    End Sub

    ' Funzione di redim
    Public Shared Sub ImgRedim(Context as HttpContext, immagine as String, width as Integer, height as Integer)

    Dim contentType as String = Context.Request.ContentType.ToUpper()

    Dim bmp as Bitmap = CType(Image.FromFile(immagine), 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 Bitmap(bmp, width, height)

    ' salvo sullo stream di output
    if contentType.EndsWith("JPEG") Then
    miniaturabmp.Save(Context.Response.OutputStream, ImageFormat.Jpeg)
    else
    miniaturabmp.Save(Context.Response.OutputStream, ImageFormat.Gif)
    end if

    ' pulizia
    miniaturabmp.Dispose()
    else
    ' salvo sullo stream di output
    if contentType.EndsWith("JPEG") Then
    bmp.Save(Context.Response.OutputStream, ImageFormat.Jpeg)
    else
    bmp.Save(Context.Response.OutputStream, ImageFormat.Gif)
    end if
    end if

    ' pulizia finale
    bmp.Dispose()

    End Sub

    Public ReadOnly Property IsReusable() as Boolean Implements IHttpHandler.IsReusable
    Get
    Return True
    End Get
    End Property

    End Class

    End Namespace

  3. #3
    Utente di HTML.it
    Registrato dal
    Jan 2006
    Messaggi
    63

    errore

    ecco l'errore

  4. #4
    Utente di HTML.it
    Registrato dal
    Jan 2006
    Messaggi
    63

    img

    img
    Immagini allegate Immagini allegate

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.