我如何可以合并在Windows Phone 2图像 [英] How can I merge 2 images on Windows Phone

查看:190
本文介绍了我如何可以合并在Windows Phone 2图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有2个图片,我想将它们合并成一个对我在Windows Phone应用。

I have 2 images and I want to merge them into one on my apps in Windows Phone.

通过我的可湿性粉剂的照相机捕捉到的第一图像,第二图像是帧(边界,过滤器等),其用户可我们的模板中进行选择。那么,如何将它们合并成一个。

The first image captured by my WP's camera, the second image is a frame (borders, filter, etc.) which user can choose among our templates. So how can I merge them into one.

感谢和问候。

推荐答案

我不太明白你的要求。不过,我想你想覆盖1的图像在另一个之上。如果是这样,已经有一个答案这里。在<电网> ,你既可以提供图像,并自定义每个图像的透明度,使其覆盖-ED

I don't quite understand what you ask. But I guess you want to overlay 1 image on top of another. If so, there is already an answer here. Inside the <grid>, you can provide both the image, and customize the opacity of each image to make it overlay-ed.

编辑: 您可以使用WriteableBitmap的为并有一个已经库这里的。加入WriteableBitmapExWinPhone在WP7项目后,您可以通过执行此合并图像和框架:

EDITED: You can use Writeablebitmap for that and there's an already library for that here. After adding the WriteableBitmapExWinPhone in your WP7 project, you can merge the image and frame by doing this:

    var photo = ...//you writeablebitmap of image here
    var frame = ...//your writeablebitmap of frame here
    var merge = new WriteableBitmap(435, 435); //size of merge canvas
    merge .Clear(Colors.White); //white background
    merge.Blit(new Rect(oX, oY, w, h), photo, new Rect(0, 0, photo.PixelWidth,        photo.PixelHeight)); //draw the photo first
    merge.Blit(new Rect(0, 0, 435, 435), frame, new Rect(0, 0, frame.PixelWidth,        frame.PixelHeight)); //draw the frame

这篇关于我如何可以合并在Windows Phone 2图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆