Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. followed this example but mine doesnt work

followed this example but mine doesnt work

Scheduled Pinned Locked Moved Visual Basic
graphicscomtutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    KamWaf
    wrote on last edited by
    #1

    I followed the example on this website: [url]http://www.eggheadcafe.com/articles/20030515.asp\[/url\] To convert a HUGE Tiff to a samller JPeg image ..[b] to reduce the dimenstions ..[/b]..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: [code] 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() [/code]

    E 1 Reply Last reply
    0
    • K KamWaf

      I followed the example on this website: [url]http://www.eggheadcafe.com/articles/20030515.asp\[/url\] To convert a HUGE Tiff to a samller JPeg image ..[b] to reduce the dimenstions ..[/b]..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: [code] 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() [/code]

      E Offline
      E Offline
      eramgarden
      wrote on last edited by
      #2

      found my answer

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups