I lang tid har samarbejdsbranchen fokuseret på at forbedre enhedsfunktioner – bedre kameraer, klarere lyd og smartere software. Men den virkelige forvandling handler ikke om funktioner.
1. hvor stort er det totale færdige billede billede (xxx * yyy) 2. hvad hedder billede 1, og hvor skal det placeres img1 (0,0) ==> slutIMG (x,y) 3. hvad hedder billede 2, og hvor skal det placeres img2 (0,0) ==> slutIMG (x,y) 4. hvad skal der stå, og hvor ? text (0,0) ==> slutIMG (x,y)
desuden... kommer det nok til at koste flere point end 15 !!!!!!!!!!!!!!
Set Image = Server.CreateObject("AspImage.Image") Image.MaxY = 300 Image.MaxX = 800
For X = pip1_x to pip1_maxX + pip1_x For Y = pip1_y to pip1_maxY + pip1_y x_pos = X - pip1_x y_pos = Y - pip1_y intColor = pip1.GetPixel( x_pos , y_pos ) Image.Setpixel X,Y,intColor Next Next
For X = pip2_x to pip2_maxX + pip2_x For Y = pip2_y to pip2_maxY + pip2_y x_pos = X - pip2_x y_pos = Y - pip2_y intColor = pip2.GetPixel( x_pos , y_pos ) Image.Setpixel X,Y,intColor Next Next
Set Image = Server.CreateObject("AspImage.Image") Image.MaxY = 300 Image.MaxX = 800
For X = pip1_x to pip1_maxX + pip1_x For Y = pip1_y to pip1_maxY + pip1_y x_pos = X - pip1_x y_pos = Y - pip1_y intColor = pip1.GetPixel( x_pos , y_pos ) Image.Setpixel X,Y,intColor Next Next
For X = pip2_x to pip2_maxX + pip2_x For Y = pip2_y to pip2_maxY + pip2_y x_pos = X - pip2_x y_pos = Y - pip2_y intColor = pip2.GetPixel( x_pos , y_pos ) Image.Setpixel X,Y,intColor Next Next
Hvis du vil "kalde" scriptet ude fra... fx <img src="pip.asp"> kan du evt. bruge Querystring til at indsætte elementerne
<img src="pip.asp? img1=img1.jpg & img1x=50 & img2x=0 & text=HEJSA"> inde i scriptet erstatter du så de definerede værdier jeg har sat... fx pip1_x = 50 med pip1_x = request.querystring("img1x")
og
strMessage = "SPASSSSERRRRRR" med strMessage = request.querystring("text")
på den måde kan du lave et mere dynamisk billede... hvis ikke du gør det... kan du jo ligså godt lave det hele i paint !!! <%
' pip = picture in picture ' start komponenten, og åben billede 1 Set pip1 = Server.CreateObject("AspImage.Image") pip1.LoadImage Server.MapPath("img1.jpg")
'get the dimmensions of pip 1, ' img1.jpg kan erstattes med reqeust("img1") pip1.GetImageFileSize Server.MapPath("img1.jpg") , pip1_maxX, pip1_maxY
' SAMME ----------------------------------------- Set pip2 = Server.CreateObject("AspImage.Image") pip2.LoadImage Server.MapPath("img2.jpg") pip2.GetImageFileSize Server.MapPath("img2.jpg") , pip2_maxX, pip2_maxY pip2_x = 400 pip2_y = 0
Set Image = Server.CreateObject("AspImage.Image") Image.MaxY = 300 Image.MaxX = 800 ' SAMME -----------------------------------------
' Løb alle X igennem hvis billedet fx er 300 bred med offset pip1_x For X = pip1_x to pip1_maxX + pip1_x ' Løb alle Y igennem hvis billedet fx er 300 højt med offset pip1_y For Y = pip1_y to pip1_maxY + pip1_y ' x_pos og y_pos er koordinater i pip1 0,0 til fx 300,300 x_pos = X - pip1_x y_pos = Y - pip1_y
' hent farven som står skrevet på koordinatet i pip1 intColor = pip1.GetPixel( x_pos , y_pos ) Image.Setpixel X,Y,intColor Next Next
' SAMME ------------------ For X = pip2_x to pip2_maxX + pip2_x For Y = pip2_y to pip2_maxY + pip2_y x_pos = X - pip2_x y_pos = Y - pip2_y intColor = pip2.GetPixel( x_pos , y_pos ) Image.Setpixel X,Y,intColor Next Next ' SAMME -------------------
men du må sku gerne give en ordentlig slat for al den kode ;-)
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.