Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I followed the example on this website:

 

http://www.eggheadcafe.com/articles/20030515.asp

 

To convert a HUGE Tiff to a samller JPeg image .. to reduce the dimenstions ....it converts the image to JPeg but still the weidth and height remain the same...it does NOT reduce the height and weidth to a smaller image..

What am I missing??

This is what I have:


Dim strFileToConvert As String


       strFileToConvert = "C:\IP\W0008-01-01.tif.jpeg"
       'Initialize the bitmap object by supplying the image file path
       Dim b As New Bitmap(strFileToConvert)

       Dim g As Graphics = Graphics.FromImage(b)

       g.CompositingQuality = Drawing2D.CompositingQuality.HighQuality
       g.SmoothingMode = Drawing2D.SmoothingMode.HighQuality
       g.InterpolationMode = Drawing2D.InterpolationMode.HighQualityBicubic
       Dim newrec As Rectangle = New Rectangle(0, 0, 50, 50)
       g.DrawImage(b, newrec)
       b.Save(strFileToConvert & ".jpeg", System.Drawing.Imaging.ImageFormat.Jpeg)

       g.Dispose()

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...