Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

edit image

Status
Not open for further replies.

dabayi

Programmer
Oct 23, 2002
10
0
0
DE
Hallo!

How please to load an image and edit it?
I mean to write something on the picture and save it back.

Thanks for helping

Dabayi
 
//1) load it
Bitmap bob = new Bitmap(Image.FromFile(filename));
//fileName is a string. it's the location of the image

//2) diddle with it
b.setPixel(x, y, c);
//x and y are co-ords, c is a Color.
//the bitmap object doesn't contain any decent tools for manipulating itself.
//if you want to do higher level ops than this, just tell me - there are ways, complecated ones.

//3) save it
Image i = Image.FromHbitmap(bob.GetHbitmap());
i.Save(filename, ImageFormat.bmp); //or whatever format you want
 
Thanks a lot. It is working!

have a nice day.

James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top