convert jpg to bmp in memory-VBForums
Results 1 to 2 of 2

Thread: convert jpg to bmp in memory

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2008
    Posts
    12

    convert jpg to bmp in memory

    ok i tried searching the internet, but the only examples i can find of doing this.. involve saving the bmp to the hard drive first, which i dont wanna do

    using the system.drawing namespace, some of the functions will only work correctly using a bitmap... but just for future reference, i dont wanna save them as bitmaps since they take up alot more space

    so im trying to find a way to convert the jpg to bmp while in memory without saving it first.. any help would be appreciated..

  2. #2
    Lively Member
    Join Date
    Jul 2008
    Posts
    107

    Re: convert jpg to bmp in memory

    etac,

    You should be able to save the jpg image to a memory stream as a bmp, and then load it from the memory stream:

    Code:
            Dim myJpgImage As Image = Image.FromFile("Abstract3.jpg")
            Dim myBmpImage As Image
            Dim ms As New System.IO.MemoryStream
    
            myJpgImage.Save(ms, ImageFormat.Bmp)
    
            myBmpImage = Image.FromStream(ms)
    Kerry Moorman

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.