<%@ Page Language="vb" Debug="true" %> <% @Import NameSpace="System.Data" %> <% @Import NameSpace="System.Data.SQLClient" %> <% @Import NameSpace="System.Diagnostics.Debug" %> <% @Import NameSpace="System.Data.OleDb" %> <% @Import NameSpace="System.Drawing" %> <%@ Import Namespace="System.Drawing.Imaging" %> <%@ Import Namespace="System.Drawing.Text" %> <%@ Import namespace="System.IO" %> <%@ Import namespace="System.Net" %> <% Dim Id_Utente = Request.QueryString("ID") Dim Yes_Coord = Request.QueryString("Yes_Coord") Dim arr arr = split(Yes_Coord, ".") Dim Pagina Pagina = Request.ServerVariables("PATH_TRANSLATED") Pagina = Mid(Pagina,1,Len(Pagina)-Len(Split(StrReverse(Pagina),"\")(0))-1) Pagina = Mid(Pagina,1,Len(Pagina)-Len(Split(StrReverse(Pagina),"\")(0))) Pagina = Pagina + "\public\Avatar_Generali_" Dim objBMP As System.Drawing.Bitmap Dim objGraphics As System.Drawing.Graphics Dim objFont As System.Drawing.Font Dim Is_General_Alive = 0 sqlConn.Open() sqlComm = New SqlCommand("SELECT Utenti.Id as Id_Utente, Utenti.Username, Utenti.Fama, Utenti.Gilda, Pianeti.Proprietary, Pianeti.Dimensione, Pianeti.Reame, Pianeti.Paese, Pianeti.Is_Principal, Pianeti.Nome as Nome_Paese, Generali.Id as Id_Generale, Generali.Proprietary, Generali.Is_Dead, Generali.Exp, Generali.Nome as Nome_Generale FROM Utenti JOIN Pianeti ON Utenti.Username = Pianeti.Proprietary AND Pianeti.Is_Principal = 1 JOIN Generali ON Utenti.Username = Generali.Proprietary AND Generali.Is_Dead = 0 WHERE Utenti.Id = '"& Id_Utente &"' ", sqlConn) r = sqlComm.ExecuteReader() While r.Read() Is_General_Alive = 1 End While r.Close() sqlConn.Close() Dim Fatto = 0 sqlConn.Open() If Is_General_Alive = 1 Then sqlComm = New SqlCommand("SELECT Utenti.Id as Id_Utente, Utenti.Username, Utenti.Fama, Utenti.Gilda, Pianeti.Proprietary, Pianeti.Dimensione, Pianeti.Reame, Pianeti.Paese, Pianeti.Is_Principal, Pianeti.Nome as Nome_Paese, Generali.Id as Id_Generale, Generali.Proprietary, Generali.Is_Dead, Generali.Exp, Generali.Nome as Nome_Generale FROM Utenti JOIN Pianeti ON Utenti.Username = Pianeti.Proprietary AND Pianeti.Is_Principal = 1 JOIN Generali ON Utenti.Username = Generali.Proprietary AND Generali.Is_Dead = 0 WHERE Utenti.Id = '"& Id_Utente &"' ", sqlConn) End If If Is_General_Alive = 0 Then sqlComm = New SqlCommand("SELECT Utenti.Id as Id_Utente, Utenti.Username, Utenti.Fama, Utenti.Gilda, Pianeti.Proprietary, Pianeti.Dimensione, Pianeti.Reame, Pianeti.Paese, Pianeti.Is_Principal, Pianeti.Nome as Nome_Paese, Generali.Id as Id_Generale, Generali.Proprietary, Generali.Is_Dead, Generali.Exp, Generali.Nome as Nome_Generale FROM Utenti JOIN Pianeti ON Utenti.Username = Pianeti.Proprietary AND Pianeti.Is_Principal = 1 JOIN Generali ON Utenti.Username = Generali.Proprietary WHERE Utenti.Id = '"& Id_Utente &"' ORDER BY Generali.Id DESC", sqlConn) End If r = sqlComm.ExecuteReader() While r.Read() AND Fatto = 0 Fatto = 1 objBMP = New Bitmap(460, 120) objGraphics = System.Drawing.Graphics.FromImage(objBMP) objGraphics.Clear(Color.white) Dim originalBitmap=new Bitmap(Server.MapPath("Muro4[1].jpg")) objGraphics.DrawImage(originalBitmap, 1, 1) originalBitmap = new Bitmap(Server.MapPath("Muro4[1].jpg")) objGraphics.DrawImage(originalBitmap, 150, 1) originalBitmap = new Bitmap(Server.MapPath("Muro4[1].jpg")) objGraphics.DrawImage(originalBitmap, 300, 1) originalBitmap = new Bitmap(Server.MapPath("../public/Avatar_Imperi_" & r("Id_Utente") &".jpg")) objGraphics.DrawImage(originalBitmap, 1, 1) Dim Nome_Utente = r("Username") If Trim(r("Gilda")) <> "" Then Nome_Utente = Nome_Utente + "[" + Trim(r("Gilda")) + "]" End If objGraphics.TextRenderingHint = TextRenderingHint.AntiAlias objFont = New Font("Arial", 11, FontStyle.Bold) objGraphics.DrawString("Nome: "& Nome_Utente, objFont, Brushes.White, 125, 10) objFont = New Font("Arial", 11, FontStyle.Bold) objGraphics.DrawString("Fama: "& r("Fama"), objFont, Brushes.White, 345, 10) objFont = New Font("Arial", 11, FontStyle.Bold) objGraphics.DrawString("Paese: "& r("Nome_Paese"), objFont, Brushes.White, 125, 45) If Yes_Coord <> "" Then If arr(0) = r("Dimensione") AND arr(1) = r("Reame") AND arr(2) = r("Paese") Then objFont = New Font("Arial", 11, FontStyle.Bold) objGraphics.DrawString("Coord: "& r("Dimensione") &"."& r("Reame") &"."& r("Paese") &"", objFont, Brushes.White, 345, 45) End If End If objFont = New Font("Arial", 11, FontStyle.Bold) objGraphics.DrawString("Generale: "& r("Nome_Generale"), objFont, Brushes.White, 125, 83) objFont = New Font("Arial", 11, FontStyle.Bold) objGraphics.DrawString("Exp: "& r("Exp"), objFont, Brushes.White, 345, 83) Response.ContentType = "image/GIF" objBMP.Save(Response.OutputStream, ImageFormat.Jpeg) objFont.Dispose() objBMP.Dispose() objGraphics.Dispose() End While r.Close() sqlConn.Close() %>