followed this example but mine doesnt work
-
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]
-
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]
found my answer