Results 1 to 2 of 2

Thread: converting jpg to bmp code?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2004
    Location
    Ma
    Posts
    19

    converting jpg to bmp code?

    hey guys-

    i wrote a program that gives the user a random backround everytime it opens, but the image has to be a bmp, otherwise windows wont change it.

    With the images I have now, its auond 70mb zipped. If I were to use jpegs it would only be 6mb.

    Anyone know how to change a file from a jpg into a bmp?

    Thanks guys.

    You've got me this far, just push me over the hump

    =Nick

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    VB Code:
    1. Imports System
    2. Imports System.Drawing
    3. Imports System.Drawing.Imaging
    4.  
    5.  
    6. Module App
    7.     Sub Main()
    8.         Dim tst As New ImageConverter()
    9.         'tst.ImagePath = "c:\ufr3.bmp"
    10.         'tst.ImageType = tst.ImageType.Tiff
    11.         'tst.Transformation = tst.Transformation.Rotate90
    12.         'tst.Quality = 100
    13.         tst.ConvertImage()
    14.     End Sub
    15. End Module
    16.  
    17. Public Class ImageConverter
    18.  
    19.  
    20.     Public Sub ConvertImage()
    21.         Dim newBitmap As Bitmap = New Bitmap("c:\1.jpg")
    22.         ' Image is saved to same locattion as original
    23.         newBitmap.Save("c:\myicon.bmp", ImageFormat.Bmp)
    24.  
    25.         newBitmap.Dispose()
    26.     End Sub
    27.  
    28.  
    29. End Class
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width