Click here to Skip to main content
15,918,742 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionWant to display Messages like the Codeproject Forum displays Pin
Rizwan Bashir19-Jun-06 3:44
Rizwan Bashir19-Jun-06 3:44 
AnswerRe: Want to display Messages like the Codeproject Forum displays Pin
progload19-Jun-06 6:46
progload19-Jun-06 6:46 
Questionhow to call vbs file within vb.net Pin
Rommelke19-Jun-06 1:46
Rommelke19-Jun-06 1:46 
AnswerRe: how to call vbs file within vb.net Pin
Dave Kreskowiak19-Jun-06 3:40
mveDave Kreskowiak19-Jun-06 3:40 
Questionprint from textboxes Pin
moveman19-Jun-06 1:31
moveman19-Jun-06 1:31 
QuestionWatermarking Problems Pin
wEb GuRu...19-Jun-06 1:15
wEb GuRu...19-Jun-06 1:15 
AnswerRe: Watermarking Problems Pin
Dave Kreskowiak19-Jun-06 5:11
mveDave Kreskowiak19-Jun-06 5:11 
GeneralRe: Watermarking Problems Pin
wEb GuRu...19-Jun-06 5:39
wEb GuRu...19-Jun-06 5:39 
Here is the code..........

<br />
 Public Sub waterMark()<br />
        Dim imageURL As String<br />
<br />
        'Set the thumbnail width in px – the width will be calculated later to keep the original ratio.<br />
        Dim imageHeight As Integer<br />
        Dim imageWidth As Integer<br />
<br />
        Dim logoX, logoY As Integer<br />
<br />
        'Original image<br />
        imageURL = Server.MapPath("watermark_images/originalImg.jpg")<br />
        Dim fullSizeImg As System.Drawing.Image<br />
        fullSizeImg = System.Drawing.Image.FromFile(imageURL)<br />
<br />
        'For Logo with which we watermark image<br />
<br />
        Dim logoImg As System.Drawing.Image<br />
        imageURL = Server.MapPath("watermark_images/logo.png")<br />
        logoImg = System.Drawing.Image.FromFile(imageURL)<br />
      <br />
        imageHeight = fullSizeImg.Height<br />
        imageWidth = fullSizeImg.Width<br />
<br />
<br />
        Response.ContentType = "image/jpeg"<br />
<br />
        If imageHeight > 0 And imageWidth > 0 Then<br />
            Dim dummyCallBack As System.Drawing.Image.GetThumbnailImageAbort<br />
            dummyCallBack = New _<br />
               System.Drawing.Image.GetThumbnailImageAbort(AddressOf ThumbnailCallback)<br />
<br />
<br />
            'Creating the Thumbnail image of same size<br />
            thumbNailImg = fullSizeImg.GetThumbnailImage(imageWidth, imageHeight, _<br />
                                                         dummyCallBack, IntPtr.Zero)<br />
<br />
<br />
<br />
            'Declaring and initializing the Graphics image<br />
            'With this image we wil draw image and watermark it<br />
            Dim g As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(thumbNailImg)<br />
<br />
<br />
            'Sets the interpolation mode for a high quality image<br />
<br />
            g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic<br />
          <br />
            'Drawing the original image<br />
            g.DrawImage(fullSizeImg, 0, 0, imageWidth, imageHeight)<br />
            'Drawing the logo on it<br />
<br />
<br />
            logoX = imageWidth * 0.02<br />
            logoY = imageHeight * 0.92<br />
            imageHeight = logoImg.Height<br />
            imageWidth = logoImg.Width<br />
<br />
            g.DrawImage(logoImg, logoX, logoY, imageWidth, imageHeight)<br />
<br />
<br />
            g.SmoothingMode = SmoothingMode.HighQuality<br />
           <br />
            thumbNailImg.Save(Server.MapPath("watermark_images/watermarkedImg.jpg"))<br />
<br />
        Else<br />
<br />
        End If<br />
<br />
<br />


Please let me know what to do with it, so that I can get watermarked image of relatively small size.

Lets work it Out.........!
GeneralRe: Watermarking Problems Pin
Dave Kreskowiak21-Jun-06 9:13
mveDave Kreskowiak21-Jun-06 9:13 
QuestionHow to sent sms/e-mail through VB Application Pin
himuskanhere19-Jun-06 0:17
himuskanhere19-Jun-06 0:17 
QuestionPrinting a Datagrid Pin
Varus19-Jun-06 0:10
Varus19-Jun-06 0:10 
AnswerRe: Printing a Datagrid Pin
Duncan Edwards Jones19-Jun-06 1:34
professionalDuncan Edwards Jones19-Jun-06 1:34 
Questionbind current row to text boxes(urgent) Pin
iramg19-Jun-06 0:10
iramg19-Jun-06 0:10 
AnswerRe: bind current row to text boxes(urgent) Pin
iramg19-Jun-06 2:10
iramg19-Jun-06 2:10 
QuestionChecked Listbox Pin
Gitosh18-Jun-06 23:46
Gitosh18-Jun-06 23:46 
Questiondatagrid Pin
taherjaorawala18-Jun-06 21:37
taherjaorawala18-Jun-06 21:37 
AnswerRe: datagrid Pin
Werries23-Jun-06 7:24
Werries23-Jun-06 7:24 
QuestionString$ function in VB6 Pin
angelagke18-Jun-06 16:51
angelagke18-Jun-06 16:51 
AnswerRe: String$ function in VB6 Pin
Colin Angus Mackay18-Jun-06 18:00
Colin Angus Mackay18-Jun-06 18:00 
GeneralRe: String$ function in VB6 Pin
angelagke18-Jun-06 19:28
angelagke18-Jun-06 19:28 
Questionsending methods to an object compiled within an exe Pin
andrucko18-Jun-06 15:41
andrucko18-Jun-06 15:41 
AnswerRe: sending methods to an object compiled within an exe Pin
Dave Kreskowiak18-Jun-06 18:38
mveDave Kreskowiak18-Jun-06 18:38 
Questionproblem using DTS in vb.net Pin
saneng18-Jun-06 3:59
saneng18-Jun-06 3:59 
Question.net 2.0 Pin
golak_6218-Jun-06 3:59
golak_6218-Jun-06 3:59 
GeneralThe ways of make the print come ture ! Pin
snailflying18-Jun-06 3:22
snailflying18-Jun-06 3:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.