Visualizzazione dei risultati da 1 a 3 su 3
  1. #1
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559

    ASPIMAGE: Scrivere su una immagine senza modificarne dimensioni e colori

    Salve, chi ha mai usato il componente AspImage?
    La documentazione http://www.serverobjects.com/comp/Aspimage.htm non mi è d'aiuto.
    Avrei la necessita di mostrare a video una immagine già sul server sovrascrivendo ad essa del testo.
    Riesco a creare on the fly una immagine scrivendoci sopra ma non riesco se l'immagine originale è già salvata da qualche parte e devo recuperarla, metterci il testo e mostrarla...
    Come fare? Grazie.

    Roby

  2. #2
    Utente di HTML.it L'avatar di kluster
    Registrato dal
    Jul 2003
    Messaggi
    1,288
    Roby,
    scaricando il sorgente per curiosita' ho visto che c'è il file MODIMG.asp a corredo dello zip

    codice:
    <%
    
      rem ********************************************************************
      rem *
      rem * Note: This demo uses the lanmannt.bmp file. You can change to
      rem *       another BMP if you like but you'll have to modify the XY
      rem *       values to fit within your BMP image or set AutoSize = true
      rem *
      rem ********************************************************************
    
      rem **********************************************************************
      rem * Instantiate the object
      rem **********************************************************************
      Set Image = Server.CreateObject("AspImage.Image")
    
      rem **********************************************************************
      rem * If AutoSize is false then any text that exceeds the current image
      rem *   will be clipped.
      rem **********************************************************************
      Image.AutoSize = false
    
      rem **********************************************************************
      rem * Load a BMP. You can load JPG and BMP files
      rem **********************************************************************
      Image.LoadImage("d:\winnt\lanmannt.bmp")
    
      rem **********************************************************************
      rem * Set some font properties, set the X and Y location and write some
      rem *   text out to the loaded image
      rem **********************************************************************
      Image.FontName = "MS Sans Serif"
      Image.FontColor = vbRed
      Image.FontSize = 6
      Image.TextOut "SteveG's Demo", 370, 57, false
    
      rem **********************************************************************
      rem * Set some font properties, set the X and Y location and write some
      rem *   3D'd text out to the loaded image
      rem **********************************************************************
      Image.Bold = True
      Image.FontSize = 12
      Image.X = 160
      Image.Y = 230
      Image.TextOut "ASP Improved Version", Image.X, Image.Y, true
    
    
      rem **********************************************************************
      rem * Demostrate the fact that X has been moved forward beyond the
      rem *   original 160. Just add 20 to bump it over a little
      rem **********************************************************************
      Image.TextOut "X =" & Image.X, Image.X + 14, Image.Y, true
    
    
      rem **********************************************************************
      rem * Show how to calculate the next Y value. We'll take the previous Y value
      rem *   of 230 and add the TextHeight of the string XYZ to determine what our
      rem *   new Y starting value should be
      rem **********************************************************************
      Image.X = 160
      Image.Y = Image.Y + Image.TextHeight("XYZ")
      Image.FontSize = 10
      Image.TextOut Now, Image.X, Image.Y, false
    
    
      rem **********************************************************************
      rem * Set the physical path for the FileName we are going to save
      rem *   NOTE: You should gen the filename dynamically for multiuser usage
      rem **********************************************************************
      Image.FileName = "d:\inetpub\wwwroot\images\lman.jpg"
    
      rem **********************************************************************
      rem * Save the image
      rem **********************************************************************
      Image.SaveImage
    
      rem **********************************************************************
      rem * Now write the <img src> tag out for the browser to pick up
      rem **********************************************************************
      Response.Write "[img][/img]
    "
    
      rem **********************************************************************
      rem * These properties give eval/registration information for the component
      rem **********************************************************************
      rem Response.Write "
    
    Expires: " & Image.Expires
      rem Response.Write "
    Version: " & Image.Version
      rem Response.Write "
    Registered To: " & Image.RegisteredTo
    
      Set Image = nothing
    
    %>
    dovrebbe essere + o meno quello che chiedevi no?
    lui dice: You can load JPG and BMP files

  3. #3
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    Si ti ringrazio, ero arrivato alla stessa conclusione facendo una prova:
    http://www.novacomitalia.com/aspimage/default4.asp

    Roby

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.