Tag: 叠加

如何将一个图像叠加到另一个图像上?

我想显示由两个图像组成的图像。 我希望image rectangle.png在它上面用image sticker.png显示,其左侧角落在像素10,10处。 这是我得到的,但我如何组合图像? Image image = new Image(); image.Source = new BitmapImage(new Uri(@”c:\test\rectangle.png”)); image.Stretch = Stretch.None; image.HorizontalAlignment = HorizontalAlignment.Left; Image imageSticker = new Image(); imageSticker.Source = new BitmapImage(new Uri(@”c:\test\sticker.png”)); image.OverlayImage(imageSticker, 10, 10); //how to do this? TheContent.Content = image;

如何将图像文件绘制/叠加到位图图像?

我有一个Kinect传感器的video输入,该传感器由存储为位图的图像托管。 我的问题是如何将图像叠加到video源上,例如.png 。 video输入显示如下图所示为位图源,我知道如何在位图上绘制一条线但是如何从资源中绘制图像呢? KinectVideo.Source = BitmapSource.Create(colorFrame.Width, colorFrame.Height, 96, 96, PixelFormats.Bgr32, null, colorData, colorFrame.Width * colorFrame.BytesPerPixel); 下面是通过将图像放在video源上来模拟我想要实现的目标: 更新了绘图方法的实现,我不认为这是正确的实现我在将图像路径添加到.DrawImage时得到无效的参数错误: void myKinect_ColorFrameReady(object sender, ColorImageFrameReadyEventArgs e) { using (ColorImageFrame colorFrame = e.OpenColorImageFrame()) { if (colorFrame == null) return; byte[] colorData = new byte[colorFrame.PixelDataLength]; colorFrame.CopyPixelDataTo(colorData); KinectVideo.Source = BitmapSource.Create(colorFrame.Width, colorFrame.Height, 96, 96, PixelFormats.Bgr32, null, colorData, colorFrame.Width * colorFrame.BytesPerPixel); Rect destRect2; […]

如何在C#中将图像叠加或叠加到video上

我试图找出如何在Visual C#中将图像叠加在(保存的文件)video上,然后重新保存它。 在过去的四个小时里,我一直试图扯掉我的头发,到处寻找,所以任何帮助都会非常感激。