Dsy Network www | forum | my | didattica | howto | wiki | el goog | stats | blog | dona | rappresentanti
Homepage
 Register   Calendar   Members  Faq   Search  Logout 
.dsy:it. : Powered by vBulletin version 2.3.1 .dsy:it. > Community > Tech > [Info] Script random per immagini
  Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
publi
.grande:maestro.

User info:
Registered: Jun 2002
Posts: 885 (0.10 al dì)
Location:
Corso:
Anno:
Time Online: 8 Days, 6:51:22 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
[Info] Script random per immagini

Nessuno sa dirmi come fare uno script che randomizzi delle immagini in una cartella e le visualizzi ridotte del 50% ?

__________________
Acchiappasogni

31-08-2005 16:59
Click Here to See the Profile for publi Click Here to See the Blog of publi Click here to Send publi a Private Message Visit publi's homepage! Find more posts by publi Add publi to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Gusher
Splinter fun club

User info:
Registered: Jan 2003
Posts: 475 (0.06 al dì)
Location: Ovunque
Corso: Informatica
Anno: Done
Time Online: 15 Days, 22:06:15 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
Re: [Info] Script random per immagini

Originally posted by publi
Nessuno sa dirmi come fare uno script che randomizzi delle immagini in una cartella e le visualizzi ridotte del 50% ?


<?php

srand ((float) microtime() * 10000000);
$input = array ("Immagine01.jpg", "Immagine02.jpg", "ImmagineN.jpg" );
$chiavi = array_rand ($input);
$handle = fopen ($input[$chiavi[0]], "rb");
$image = fread($handle, filesize($input[$chiavi[0]]));
fclose($handle);
Header("Content-type: image/jpeg");
echo $image;

?>


Estrae a caso dall'array un immagine.
Per fare il resize dai un occhio alle GD.

In particolare a:

http://it.php.net/manual/en/functio...pyresampled.php
http://it.php.net/manual/en/functio...copyresized.php

31-08-2005 17:46
Click Here to See the Profile for Gusher Click Here to See the Blog of Gusher Click here to Send Gusher a Private Message Find more posts by Gusher Add Gusher to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
0m4r
.grande:maestro.

User info:
Registered: Mar 2002
Posts: 7287 (0.84 al dì)
Location: Düsseldorf (DE)
Corso:
Anno: ESAMI FINITI
Time Online: 49 Days, 0:57:33 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

se il problema è solo visualizzarle senza realmente ridurle di dimensione puoi usare un javascript tipo questo:

code:
function changeImage(){ var image1 = new Image(); image1.src = "image03.gif"; var image2 = new Image(); image2.src = "image05.gif"; var image3 = new Image(); image3.src = "image07.gif"; var image4 = new Image(); image4.src = "image09.gif"; var arrayImage = {image1, image2, image3, image4}; var ranNum= Math.round(Math.random()*4); var r = (ranNum%(arrayImage.length))+1; document.getElementById('img').src = arrayImage[r].src; setTimeout("changeImage()", 1000); }


mentre nella pagina html avrai una cosa del tipo
code:
<html> <head> [omissis] </head> <body onLoad="changeImage();"> <img id="img" src="immagine.gif" width="50%"> </body> </html>

__________________
http://www.twitter.com/0m4r

31-08-2005 19:41
Click Here to See the Profile for 0m4r Click Here to See the Blog of 0m4r Click here to Send 0m4r a Private Message Find more posts by 0m4r Add 0m4r to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
N@RV1
www.narv1.net

User info:
Registered: Jan 2004
Posts: 759 (0.09 al dì)
Location: Garbagnate Milanese
Corso: TICOM
Anno: Primo
Time Online: 9 Days, 9:55:12 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

<%@ Page Language="VB" ContentType="text/html" %>
<form runat="server">
<asp:Image ID="rndImg" runat="server" />
</form>
<SCRIPT language="VB" runat="server">
Sub Page_Load(Src As Object, E As EventArgs)
Dim Randi as New Random()
rndImg.ImageUrl = Randi.Next(1, 9).ToString() & ".jpg"
End Sub
</SCRIPT>

in asp.net unico difetto e che devi chiamare i file con numeri 1.jpg 2.jpg ecc...

__________________
.:N@RV!:.

31-08-2005 21:12
Click Here to See the Profile for N@RV1 Click here to Send N@RV1 a Private Message Visit N@RV1's homepage! Find more posts by N@RV1 Add N@RV1 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
ripe
- up in the mountains -

User info:
Registered: Jun 2002
Posts: 9469 (1.10 al dì)
Location: Cinisellooo
Corso: TICO TICO
Anno: Primo
Time Online: 61 Days, 2:33:39 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Per quanto riguarda il ridimensionamento dinamico dell'immagine, in Asp.Net ho scritto una classe che si occupa di tutto il lavoro. Se ti interessa fammi un fischio!

__________________
«And if you ever smell christian blood up in the mountains, then get your axe and chop them down!»

01-09-2005 10:50
Click Here to See the Profile for ripe Click Here to See the Blog of ripe Click here to Send ripe a Private Message Find more posts by ripe Add ripe to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
0m4r
.grande:maestro.

User info:
Registered: Mar 2002
Posts: 7287 (0.84 al dì)
Location: Düsseldorf (DE)
Corso:
Anno: ESAMI FINITI
Time Online: 49 Days, 0:57:33 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

sei riuscito a trovare uno script utile per il tuo scopo?

__________________
http://www.twitter.com/0m4r

08-09-2005 11:21
Click Here to See the Profile for 0m4r Click Here to See the Blog of 0m4r Click here to Send 0m4r a Private Message Find more posts by 0m4r Add 0m4r to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
publi
.grande:maestro.

User info:
Registered: Jun 2002
Posts: 885 (0.10 al dì)
Location:
Corso:
Anno:
Time Online: 8 Days, 6:51:22 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by 0m4r
sei riuscito a trovare uno script utile per il tuo scopo?


Si scusate se nn ho singraziato, lo faccio ora, ma ero preso da quell'afafre li :D

Grazie a tutti!!! Vi darei un bacio ma siete tutti ometti... :shock:

__________________
Acchiappasogni

08-09-2005 11:42
Click Here to See the Profile for publi Click Here to See the Blog of publi Click here to Send publi a Private Message Visit publi's homepage! Find more posts by publi Add publi to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 05:55.    Post New Thread    Post A Reply
  Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread | Add to Bookmarks

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is ON
 

Powered by: vBulletin v2.3.1 - Copyright ©2000 - 2002, Jelsoft Enterprises Limited
Mantained by dsy crew (email) | Collabora con noi | Segnalaci un bug | Archive | Regolamento | Licenze | Thanks | Syndacate
Pagina generata in 0.150 seconds (62.58% PHP - 37.42% MySQL) con 25 query.