简体   繁体   English

Windows Phone 8.1中的图像重叠

[英]Image Overlaping in Windows Phone 8.1

I am creating a Windows Phone Application, in which i require an image (let it be image1). 我正在创建Windows Phone应用程序,在其中我需要一个图像(将其设为image1)。 I have 100 other images, what i want is to overlap each image, to the image1 when needed. 我有100个其他图像,我想要的是在需要时将每个图像重叠到image1。

(Note: I want to save the image after editing) (注意:我要在编辑后保存图像)

What will be the possible way to create this in Windows Phone. 在Windows Phone中创建此功能的可能方法是什么。

I am familiar with C# in WPForms, and i used this code before... 我熟悉WPForms中的C#,并且在...之前使用了此代码。

//In this code i am drawing 2.png on 1.png //在这段代码中,我正在1.png上绘制2.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);
        }

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. 将位图bmpCurrentScreenImage保存到要保存的位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM