dakota97 Posted August 7, 2008 Posted August 7, 2008 Hi all, Is it possible to create a new .jpg file from 2 colors that a user selects in a WinForms app? What I want to do is give the user an option to select 2 colors using a colorpicker. When they click "save", I want to create a new 1px wide by 1050px high gradient style image to be used as a webpage background, and save it so that it can be uploaded to a web server via FTP. The uploading I can handle, but I need to know if there's a way to create the image file. Thanks in advance, -Chris Quote if(computer.speed == "slow") { hamster.feed(); } if(computer.speed == "really slow") { hamster.kill(); BuyNewHamster(); }
Administrators PlausiblyDamp Posted August 7, 2008 Administrators Posted August 7, 2008 The following should get you started LinearGradientBrush b = new LinearGradientBrush(new Rectangle(0,0,100,100),Color.Red, Color.Blue, 45f ); Bitmap bmp = new Bitmap(100,100); Graphics g = Graphics.FromImage(bmp); g.FillRectangle(b,0,0,100,100); bmp.Save("c:\\test.bmp"); Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.