Click here to Skip to main content
15,891,938 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more: , +
i am having an image1 in a picturebox1 and another image2 on another picturebox2, i want to put image2 from picturebox2 on image1 in picturebox1.
i am using c# language.

plz any one help me in this regard.if code provided i will be greatly thankful
Posted
Comments
Sergey Alexandrovich Kryukov 12-Jun-11 14:36pm    
Tag platform and language, to get a real answer.
--SA

1 solution

That's going to depend on what you mean by "put an image on an image".
If you mean "draw an image on part of another image, destroying what is underneath" then all you need to do is:
using (Graphic g = Graphics.FromImage(myTargetPictureBox.Image))
   {
   g.DrawImage(mySourcePictureBox.Image, new Point(100,100));
   }
 
Share this answer
 
Comments
asma89 12-Jun-11 12:26pm    
Thanks for your kind concern but its not working its not giving any error but when i click the picturebox the image is not drawn on another image in another picturebox.

what should i do ?
Sergey Alexandrovich Kryukov 12-Jun-11 14:36pm    
It does work. If it does not work for you, show a bigger part of code.
--SA
Sergey Alexandrovich Kryukov 12-Jun-11 14:38pm    
For example, your original point of second image can be outside of the clip area of the first one; could be different reasons. Check up the geometry and show your code.
--Sa
Sergey Alexandrovich Kryukov 12-Jun-11 14:37pm    
Correct, a 5.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900