all groups > vj# > january 2005 >
You're in the

vj#

group:

Convert jpg to bmp


Convert jpg to bmp Sushovan
1/23/2005 6:55:01 AM
vj#: I am trying to make a wallpaper changer for my computer using vjsharp. I have
done it , but it accepts only bmp files. I need to figure out a way to
convert jpg files to bmp so that I can make the program convert it and use it
as a wallpaper. Is there a standard library function to do so?
A code snippet will also do great.
Thanks,
--
Re: Convert jpg to bmp Lars-Inge Tønnessen [VJ# MVP]
1/23/2005 9:22:31 PM

Hi Sushovan,

You can convert/copy a jpg file to a bmp file with these two lines:

System.Drawing.Image bitmap = System.Drawing.Image.FromFile("yourjpg.jpg");
bitmap.save( "newBitmap.bmp",
System.Drawing.Imaging.ImageFormat.get_Bmp() );


Best Regards,
Lars-Inge Tønnessen

Re: Convert jpg to bmp Sushovan
1/24/2005 11:03:07 AM
Dear Lars-Inge Tønnessen,

Thank you so much for the code snippet, it works perfectly. I will now
add the functionality of choosing a random file and schedule it on windows,
and my wallpaper changer is ready!

Sushovan


[quoted text, click to view]
Re: Convert jpg to bmp Lars-Inge Tønnessen [VJ# MVP]
1/24/2005 9:38:43 PM

=:o)

Lars-Inge

AddThis Social Bookmark Button