c# - Draw 2 pictureboxes in one bitmap -


i'm c# beginner , i'm wondering if there way draw 2 images 2 different pictureboxes , save 1 image using method drawtobitmap.

i can preview nice in program (it looks good), main problem when save picture, it's showing picturebox1 blank-alike icon of picturebox2 in middle :/

here's part of code , it's not working should

picturebox2.imagelocation = potdoslike; bitmap bmp = new bitmap(picturebox1.width, picturebox1.height); picturebox1.drawtobitmap(bmp, picturebox1.bounds); picturebox2.drawtobitmap(bmp, picturebox2.bounds); bmp.save(@"d:\asd.jpg"); 

i figured out! problem didn't save picturebox.image , couldn't draw nothing out... here's code!

picturebox2.parent = picturebox1; picturebox2.imagelocation = potdoslike; picturebox2.image = image.fromfile(potdoslike); bitmap bmp = new bitmap(picturebox1.image); picturebox1.drawtobitmap(bmp, picturebox1.bounds); picturebox2.drawtobitmap(bmp, picturebox2.bounds); bmp.save(@"d:\asd.jpg"); 

Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -