1

I am creating a Windows Phone Application, in which i require an image (let it be image1). I have 100 other images, what i want is to overlap each image, to the image1 when needed.

(Note: I want to save the image after editing)

What will be the possible way to create this in Windows Phone.

I am familiar with C# in WPForms, and i used this code before...

//In this code i am drawing 2.png on 1.png

        string imageFilePath = @"D:\1.png";
        Bitmap bitmap = (Bitmap)Image.FromFile(imageFilePath);//load the image file

        string image = @"D:\2.png";
        Bitmap bitmap2 = (Bitmap)Image.FromFile(image);//load the image file

        using (Graphics graphics = Graphics.FromImage(bitmap))
        {
            graphics.DrawImageUnscaled(bitmap2, 5, 5);
        }
pnuts
  • 58,317
  • 11
  • 87
  • 139
Navjot Singh
  • 138
  • 2
  • 10
  • one question posted for the same was http://stackoverflow.com/questions/12453528/draw-image-at-specific-position-onto-an-existing-image but no response.... – Navjot Singh May 29 '14 at 14:13
  • possible duplicate of [How can I merge 2 images on Windows Phone](http://stackoverflow.com/questions/10099885/how-can-i-merge-2-images-on-windows-phone) – Matt Lacey May 29 '14 at 16:16

1 Answers1

0

Try This:

WriteableBitmap bmpCurrentScreenImage = new WriteableBitmap((int)this.ActualWidth, (int)this.ActualHeight);
bmpCurrentScreenImage.Render(LayoutRoot, new MatrixTransform());
bmpCurrentScreenImage.Invalidate();

Save Bitmap bmpCurrentScreenImage where You want to save.

Amit Bhatiya
  • 2,621
  • 1
  • 12
  • 20