我有一个不透明度大约70%的遮罩图像,我有另一张从服务器下载的图像。如何将它们重绘为单个图像,使下载的图像位于蒙版图像的正下方?我不想使用画布,因为我将使用合并图像作为全景背景,而画布将不起作用。
这样的事情:
using (Graphics grfx = Graphics.FromImage(image))
{
grfx.DrawImage(newImage, x, y)
}
我试过这个但没有运气:
BitmapImage bmp = new BitmapImage();
BitmapImage bi = new BitmapImage();
ImageBrush imageBrush = new ImageBrush();
ImageBrush imageBrush2 = new ImageBrush();
bi.UriSource = new Uri("Images/MainPage/mask_bg.png", UriKind.Relative);
bmp.UriSource = new Uri("Images/MainPage/covertart_bg.jpg", UriKind.Relative);
TranslateTransform translate = new TranslateTransform
{
X = 0,
Y = 0
};
imageBrush.ImageSource = bmp;
ImageCanvas canvas = new ImageCanvas();
canvas.Background = imageBrush;
WriteableBitmap w_bitmap = new WriteableBitmap(1065, 800);
w_bitmap.Render(canvas, translate);
w_bitmap.Invalidate();
imageBrush2.ImageSource = w_bitmap;
mainPanorama.Background = imageBrush2;