Line 1: #ExternalChecksum("D:\inetpub\webs\guidalocalitv\water_eventi.aspx","{ff1816ec-aa5e-4d10-87f7-6f4963833460}","06A09EB5DD6E3BFCC1EF6F1A4FB669393B91EFA6")
Line 2: '------------------------------------------------------------------------------
Line 3: ' <auto-generated>
Line 4: ' This code was generated by a tool.
Line 5: ' Runtime Version:4.0.30319.42000
Line 6: '
Line 7: ' Changes to this file may cause incorrect behavior and will be lost if
Line 8: ' the code is regenerated.
Line 9: ' </auto-generated>
Line 10: '------------------------------------------------------------------------------
Line 11:
Line 12: Option Strict Off
Line 13: Option Explicit On
Line 14:
Line 15: Imports Microsoft.VisualBasic
Line 16: Imports System
Line 17: Imports System.Collections
Line 18: Imports System.Collections.Generic
Line 19: Imports System.Collections.Specialized
Line 20: Imports System.ComponentModel.DataAnnotations
Line 21: Imports System.Configuration
Line 22: Imports System.Data
Line 23: Imports System.Data.SqlClient
Line 24: Imports system.drawing
Line 25: Imports System.Drawing.Drawing2D
Line 26: Imports System.Drawing.Imaging
Line 27: Imports System.Linq
Line 28: Imports System.Text
Line 29: Imports System.Text.RegularExpressions
Line 30: Imports System.Web
Line 31: Imports System.Web.Caching
Line 32: Imports System.Web.DynamicData
Line 33: Imports System.Web.Profile
Line 34: Imports System.Web.Security
Line 35: Imports System.Web.SessionState
Line 36: Imports System.Web.UI
Line 37: Imports System.Web.UI.HtmlControls
Line 38: Imports System.Web.UI.WebControls
Line 39: Imports System.Web.UI.WebControls.WebParts
Line 40: Imports System.Xml.Linq
Line 41:
Line 42: Namespace ASP
Line 43:
Line 44: <System.Runtime.CompilerServices.CompilerGlobalScopeAttribute()> _
Line 45: Public Class water_eventi_aspx
Line 46: Inherits Global.System.Web.UI.Page
Line 47: Implements System.Web.SessionState.IRequiresSessionState, System.Web.IHttpHandler
Line 48:
Line 49: Private Shared __initialized As Boolean
Line 50:
Line 51: Private Shared __fileDependencies As Object
Line 52:
Line 53:
Line 54: #ExternalSource("D:\inetpub\webs\guidalocalitv\water_eventi.aspx",11)
Line 55:
Line 56: Shared conn As New SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings("ConnectionString").ToString)
Line 57:
Line 58:
Line 59: Function ThumbnailCallback() As Boolean
Line 60: Return False
Line 61: End Function
Line 62:
Line 63:
Line 64: Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
Line 65:
Line 66: 'Get the image name – yourimage.jpg – from the query String
Line 67:
Line 68: Dim imageURL As String = Request.QueryString("img")
Line 69: Dim imageHeight As Integer
Line 70:
Line 71: 'Set the thumbnail width in px – the width will be calculated later to keep the original ratio.
Line 72:
Line 73: Dim imageWidth As Integer = 0
Line 74: Dim CurrentimgHeight As Integer
Line 75: Dim CurrentimgWidth As Integer
Line 76:
Line 77:
Line 78:
Line 79: 'imageURL = "C:\YourImageFolder\" & imageURL
Line 80: imageURL = Server.MapPath("~/docs/eventi").Replace(Application("cartella_server"), Config.Folder_source) & "\" & imageURL
Line 81: '"C:\YourImageFolder\" & imageURL
Line 82:
Line 83: Dim fullSizeImg As System.Drawing.Image
Line 84: fullSizeImg = System.Drawing.Image.FromFile(imageURL)
Line 85:
Line 86: CurrentimgHeight = fullSizeImg.Height
Line 87: CurrentimgWidth = fullSizeImg.Width
Line 88: 'imageHeight = CurrentimgHeight / CurrentimgWidth * imageWidth
Line 89: imageHeight = CurrentimgHeight
Line 90: imageWidth = CurrentimgWidth
Line 91:
Line 92: 'This will only work for jpeg images
Line 93:
Line 94: Response.ContentType = "image/jpeg"
Line 95: If imageHeight > 0 And imageWidth > 0 Then
Line 96: Dim dummyCallBack As System.Drawing.Image.GetThumbnailImageAbort
Line 97: dummyCallBack = New System.Drawing.Image.GetThumbnailImageAbort(AddressOf ThumbnailCallback)
Line 98:
Line 99: Dim thumbNailImg As System.Drawing.Image
Line 100: thumbNailImg = fullSizeImg.GetThumbnailImage(imageWidth, imageHeight, _
Line 101: dummyCallBack, IntPtr.Zero)
Line 102:
Line 103: Dim g As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(thumbNailImg)
Line 104:
Line 105: 'Dim StringSizeF As SizeF, DesiredWidth As Single, wmFont As Font, RequiredFontSize As Single, Ratio As Single
Line 106:
Line 107: 'Dim strWatermark = "guidalocaligenova.it"
Line 108:
Line 109: 'Set the watermark font
Line 110:
Line 111: 'wmFont = New Font("Arial", 14, FontStyle.Bold)
Line 112: 'DesiredWidth = imageWidth * 0.5
Line 113:
Line 114: 'use the MeasureString method to position the watermark in the centre of the image
Line 115:
Line 116: ' StringSizeF = g.MeasureString(strWatermark, wmFont)
Line 117: 'Ratio = StringSizeF.Width / wmFont.SizeInPoints
Line 118: 'RequiredFontSize = DesiredWidth / Ratio
Line 119: 'wmFont = New Font("Arial", RequiredFontSize, FontStyle.Bold)
Line 120:
Line 121: 'Sets the interpolation mode for a high quality image
Line 122:
Line 123: g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic
Line 124: g.DrawImage(fullSizeImg, 0, 0, imageWidth, imageHeight)
Line 125: g.SmoothingMode = SmoothingMode.HighQuality
Line 126:
Line 127: 'Dim letterBrush As SolidBrush = New SolidBrush(Color.FromArgb(50, 255, 255, 255))
Line 128: 'Dim shadowBrush As SolidBrush = New SolidBrush(Color.FromArgb(50, 0, 0, 0))
Line 129:
Line 130: 'Enter the watermark text
Line 131:
Line 132: 'If Not (conn.State = ConnectionState.Open) Then
Line 133: ' conn.Open()
Line 134: 'End If
Line 135:
Line 136: ''recupero record totali
Line 137: 'Dim img_db As string = ""
Line 138:
Line 139: 'Dim SqlS As String = "SELECT immagine FROM guide WHERE id_guida=" & Config.Guida
Line 140:
Line 141: 'Using myCommandSt As New SqlCommand(SqlS, conn)
Line 142: ' Dim myReaderSt As SqlDataReader
Line 143: ' myReaderSt = myCommandSt.ExecuteReader()
Line 144: ' While myReaderSt.Read()
Line 145: ' img_db = myReaderSt("immagine")
Line 146: ' End While
Line 147: ' myReaderSt.Close()
Line 148: 'End Using
Line 149:
Line 150: 'conn.Close()
Line 151:
Line 152: Dim logo As New Drawing.Bitmap(Server.MapPath("~/docs/loghi_guide/" & Application("logo_guida")).Replace(Application("cartella_server"), Config.Folder_source))
Line 153:
Line 154: 'g.DrawString("guidalocaligenova.it", wmFont, shadowBrush, 75, (imageHeight * 0.5) - 36)
Line 155: 'g.DrawString("guidalocaligenova.it", wmFont, letterBrush, 77, (imageHeight * 0.5) - 38)
Line 156:
Line 157: Dim coord_x As Integer
Line 158: 'per allineamento a sx
Line 159: coord_x = 10
Line 160: 'per allineamento a dx
Line 161: coord_x = imageWidth - logo.Width
Line 162:
Line 163: g.DrawImage(Basepage.SetImgOpacity(logo, 0.35), New Drawing.Point(coord_x, imageHeight - logo.Height))
Line 164:
Line 165: thumbNailImg.Save(Response.OutputStream, ImageFormat.Jpeg)
Line 166:
Line 167: Else
Line 168: fullSizeImg.Save(Response.OutputStream, ImageFormat.Jpeg)
Line 169:
Line 170: End If
Line 171:
Line 172: 'Important, dispose of the image – otherwise the image file will be locked by the server for several minutes
Line 173:
Line 174: fullSizeImg.Dispose()
Line 175:
Line 176: End Sub
Line 177:
Line 178:
Line 179:
Line 180:
Line 181:
Line 182:
Line 183: #End ExternalSource
Line 184:
Line 185:
Line 186: <System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Line 187: Public Sub New()
Line 188: MyBase.New
Line 189: Dim dependencies() As String
Line 190: CType(Me,Global.System.Web.UI.Page).AppRelativeVirtualPath = "~/water_eventi.aspx"
Line 191: If (Global.ASP.water_eventi_aspx.__initialized = false) Then
Line 192: dependencies = New String(0) {}
Line 193: dependencies(0) = "~/water_eventi.aspx"
Line 194: Global.ASP.water_eventi_aspx.__fileDependencies = Me.GetWrappedFileDependencies(dependencies)
Line 195: Global.ASP.water_eventi_aspx.__initialized = true
Line 196: End If
Line 197: Me.Server.ScriptTimeout = 30000000
Line 198: End Sub
Line 199:
Line 200: Protected ReadOnly Property Profile() As System.Web.Profile.DefaultProfile
Line 201: Get
Line 202: Return CType(Me.Context.Profile,System.Web.Profile.DefaultProfile)
Line 203: End Get
Line 204: End Property
Line 205:
Line 206: Protected ReadOnly Property ApplicationInstance() As ASP.global_asax
Line 207: Get
Line 208: Return CType(Me.Context.ApplicationInstance,ASP.global_asax)
Line 209: End Get
Line 210: End Property
Line 211:
Line 212: <System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Line 213: Private Function __BuildControl__control3() As Global.System.Web.UI.HtmlControls.HtmlTitle
Line 214: Dim __ctrl As Global.System.Web.UI.HtmlControls.HtmlTitle
Line 215:
Line 216: #ExternalSource("D:\inetpub\webs\guidalocalitv\water_eventi.aspx",268)
Line 217: __ctrl = New Global.System.Web.UI.HtmlControls.HtmlTitle()
Line 218:
Line 219: #End ExternalSource
Line 220: Return __ctrl
Line 221: End Function
Line 222:
Line 223: <System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Line 224: Private Function __BuildControl__control2() As Global.System.Web.UI.HtmlControls.HtmlHead
Line 225: Dim __ctrl As Global.System.Web.UI.HtmlControls.HtmlHead
Line 226:
Line 227: #ExternalSource("D:\inetpub\webs\guidalocalitv\water_eventi.aspx",268)
Line 228: __ctrl = New Global.System.Web.UI.HtmlControls.HtmlHead("head")
Line 229:
Line 230: #End ExternalSource
Line 231: Dim __ctrl1 As Global.System.Web.UI.HtmlControls.HtmlTitle
Line 232:
Line 233: #ExternalSource("D:\inetpub\webs\guidalocalitv\water_eventi.aspx",268)
Line 234: __ctrl1 = Me.__BuildControl__control3
Line 235:
Line 236: #End ExternalSource
Line 237: Dim __parser As System.Web.UI.IParserAccessor = CType(__ctrl,System.Web.UI.IParserAccessor)
Line 238:
Line 239: #ExternalSource("D:\inetpub\webs\guidalocalitv\water_eventi.aspx",268)
Line 240: __parser.AddParsedSubObject(__ctrl1)
Line 241:
Line 242: #End ExternalSource
Line 243: Return __ctrl
Line 244: End Function
Line 245:
Line 246: <System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Line 247: Private Sub __BuildControlTree(ByVal __ctrl As water_eventi_aspx)
Line 248:
Line 249: #ExternalSource("D:\inetpub\webs\guidalocalitv\water_eventi.aspx",1)
Line 250: Me.InitializeCulture
Line 251:
Line 252: #End ExternalSource
Line 253: Dim __parser As System.Web.UI.IParserAccessor = CType(__ctrl,System.Web.UI.IParserAccessor)
Line 254:
Line 255: #ExternalSource("D:\inetpub\webs\guidalocalitv\water_eventi.aspx",1)
Line 256: __parser.AddParsedSubObject(New System.Web.UI.LiteralControl(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"<html>"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)))
Line 257:
Line 258: #End ExternalSource
Line 259: Dim __ctrl1 As Global.System.Web.UI.HtmlControls.HtmlHead
Line 260:
Line 261: #ExternalSource("D:\inetpub\webs\guidalocalitv\water_eventi.aspx",1)
Line 262: __ctrl1 = Me.__BuildControl__control2
Line 263:
Line 264: #End ExternalSource
Line 265:
Line 266: #ExternalSource("D:\inetpub\webs\guidalocalitv\water_eventi.aspx",1)
Line 267: __parser.AddParsedSubObject(__ctrl1)
Line 268:
Line 269: #End ExternalSource
Line 270:
Line 271: #ExternalSource("D:\inetpub\webs\guidalocalitv\water_eventi.aspx",1)
Line 272: __parser.AddParsedSubObject(New System.Web.UI.LiteralControl(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"<body></body>"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"</html>"))
Line 273:
Line 274: #End ExternalSource
Line 275: End Sub
Line 276:
Line 277: <System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Line 278: Protected Overrides Sub FrameworkInitialize()
Line 279: MyBase.FrameworkInitialize
Line 280: Me.__BuildControlTree(Me)
Line 281: Me.AddWrappedFileDependencies(Global.ASP.water_eventi_aspx.__fileDependencies)
Line 282: Me.Request.ValidateInput
Line 283: End Sub
Line 284:
Line 285: <System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Line 286: Public Overrides Function GetTypeHashCode() As Integer
Line 287: Return 781611360
Line 288: End Function
Line 289:
Line 290: <System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Line 291: Public Overrides Sub ProcessRequest(ByVal context As System.Web.HttpContext)
Line 292: MyBase.ProcessRequest(context)
Line 293: End Sub
Line 294: End Class
Line 295: End Namespace
Line 296:
|