Uploading Image and Creating Water Mark
Dim MyFile As HtmlControls.HtmlInputFile = CType(Page.FindControl("File1"), HtmlControls.HtmlInputFile)
Dim fileName As String = MyFile.PostedFile.FileName.Substring
(MyFile.PostedFile.FileName.LastIndexOf("\") + 1)
Dim image As System.Drawing.Image = System.Drawing.Image.FromStream(MyFile.PostedFile.InputStream)
MyFile.PostedFile.SaveAs(filePath)
Dim bitmap_Large As Bitmap = New Bitmap(image)
Dim bitmap_Thumb As Bitmap = New Bitmap(image, 118, 118)
Dim GraphicsWriter As Graphics = Graphics.FromImage(bitmap_Large)
Dim stringFormat As New StringFormat
stringFormat.FormatFlags = StringFormatFlags.DirectionVertical GraphicsWriter.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias GraphicsWriter.FillRectangle(Brushes.Green, 0, 0, 25, bitmap_Large.Height) GraphicsWriter.DrawString("Copyright MyDomain.com " & DateTime.Now.Year, New Font("Verdana", 12, FontStyle.Bold), Brushes.White, New PointF(0, (bitmap_Large.Height / 2) - 122), stringFormat)
bitmap_Large.Save(MapPath("..\upload\Large\" & FileName & ".jpg"), image.RawFormat)
bitmap_Thumb.Save(MapPath("..\upload\thumb\" & FileName & ".jpg"), image.RawFormat)
Monday, May 07, 2007
Subscribe to:
Post Comments (Atom)
8 comments:
Nice code snippet!
Good Example.
Simple and Objective (y)
good stuff!!
put it on dotnetmadness as well
Good man tha Lal tain .. but I have seen the same code infact the same variable name on several of my projects.
I guess... you have steal it ...
Good ...
AN EVERAGE ARTIST COPIES
BUT A GREAT ARTIST STEALS.
you are the great one
cheers
Good work Mr Arshad
Does this link belong to you or some other arshad
http://www.myhpf.co.uk/apply001.asp?Friend=298034
hi friend i m arshad rasheed from india www.artshadrsd.blogspot.com
www.arshadrsd.blogspot.com
porn [url=http://pornushi.ru/english-version/extrem-sex/site-373.htm]www extreme sex tube[/url]
Post a Comment