我正在用 C# 和 WinForm 创建著名的“Lingo”游戏,并且当这个词被正确猜到时,我就参与其中。我的“字母游戏”包含 25 个标签和 25 个图片框(用于 5 个字母游戏),我想像在真实电视游戏中一样为当前行设置动画示例1
我尝试通过 MS PowerPoint 制作视频(成功)并在背景中播放声音。但是视频显示在字母的顶部,因此不再可见。但为此,我必须为另一个游戏的新长度制作一个新视频。
在一些谷歌搜索之后,我发现图片编辑是可能的,所以我正在使用一个找到的程序的一部分,用于图片框的亮度编辑器。
for (int x = 0; x != 5; x++)
{
float brightness = 1.0f; // no change in brightness
float contrast = 1.0f; // twice the contrast
float gamma = 1.0f; // no change in gamma
float adjustedBrightness = brightness - 1.0f;
// create matrix that will brighten and contrast the image
float[][] ptsArray ={
new float[] {contrast, 0, 0, 0, 0}, // scale red
new float[] {0, contrast, 0, 0, 0}, // scale green
new float[] {0, 0, contrast, 0, 0}, // scale blue
new float[] {0, 0, 0, 1.0f, 0}, // don't scale alpha
new float[] {adjustedBrightness, adjustedBrightness, adjustedBrightness, 0, 1}};
ImageAttributes imageAttributes = new ImageAttributes();
imageAttributes.ClearColorMatrix();
imageAttributes.SetColorMatrix(new ColorMatrix(ptsArray), ColorMatrixFlag.Default, ColorAdjustType.Bitmap);
imageAttributes.SetGamma(gamma, ColorAdjustType.Bitmap);
Graphics g = Graphics.FromImage(v[0, 1].BackgroundImage);
g.DrawImage(v[0, 1].BackgroundImage, new Rectangle(0, 0, v[0, 1].BackgroundImage.Width, v[0, 1].BackgroundImage.Height)
, 0, 0, v[0, 1].BackgroundImage.Width, v[0, 1].BackgroundImage.Height,
GraphicsUnit.Pixel, imageAttributes);
}
}
但是亮度应该应用在所有 5 个当前行图片框上,但之后很少和之后将更多的亮度增加到最大值,然后降低亮度(用于闪光效果)。有没有办法以流畅的方式做到这一点/我应该使用视频选项还是上面的选项?或者也许 WinForm nog 适合这个?
繁星点点滴滴
相关分类