renaming a picture to a file

i need to change the format of an image from jpg to dll so i can use it as an icon.

im using this vb code to handle the conversion

theBitmapSize.Save(savefiledialog1, System.Drawing.Imaging.ImageFormat.dll)

i can't get it to accept the dll part

can someone help



Answer this question

renaming a picture to a file

  • anarcosta

    Hi,

    When does it say the file contains no icons The simple code snippet works.



    Bitmap bmp = new Bitmap("D:\\test.jpg");
    bmp.Save("D:\\test.ico", System.Drawing.Imaging.ImageFormat.Icon);

    And I think it's no necessary to save it as a dll file, simply an icon file is ok.



  • Evan Mulawski

    Please help
  • Jim Kilmer

    The reason you got errors when trying to save it as ImageFormat dll is because dll is not an image format. At all. Gqlu's method works good except that when you go to view your icon via Windows Explorer, it will not show its picture in certain views. You will have to use the GetThumbnail function to fix this I believe.


  • lustigorMolch

    And what's wrong with using this:

    theBitmapSize.Save(savefiledialog1, System.Drawing.Imaging.ImageFormat.Icon)



  • Edward Kong

    when i go to set it as the icon for a file, it says the file C:\test.ico contains no icons

    i cant get it to work


  • renaming a picture to a file