繁体   English   中英

Windows Phone 8.1中的图像重叠

[英]Image Overlaping in Windows Phone 8.1

我正在创建Windows Phone应用程序,在其中我需要一个图像(将其设为image1)。 我有100个其他图像,我想要的是在需要时将每个图像重叠到image1。

(注意:我要在编辑后保存图像)

在Windows Phone中创建此功能的可能方法是什么。

我熟悉WPForms中的C#,并且在...之前使用了此代码。

//在这段代码中,我正在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);
        }

尝试这个:

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

将位图bmpCurrentScreenImage保存到要保存的位置。

暂无
暂无

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

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