• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# SlimDX.Color4类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中SlimDX.Color4的典型用法代码示例。如果您正苦于以下问题:C# Color4类的具体用法?C# Color4怎么用?C# Color4使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Color4类属于SlimDX命名空间,在下文中一共展示了Color4类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: DrawLine

 public static void DrawLine(Location from, Location to, Color4 color)
 {
     var vertices = new PositionColored[2];
     vertices[0] = new PositionColored(from.ToVector3(), color.ToArgb());
     vertices[1] = new PositionColored(to.ToVector3(), color.ToArgb());
     Device.DrawUserPrimitives(PrimitiveType.LineList, 1, vertices);
 }
开发者ID:aash,项目名称:cleanCore,代码行数:7,代码来源:Rendering.cs


示例2: Text

 public Text(int x, int y, string text, Color4 color)
 {
     X = x;
     Y = y;
     String = text;
     Color = color;
 }
开发者ID:nohbdy,项目名称:ffxivmodelviewer,代码行数:7,代码来源:Text.cs


示例3: SkyBox

        public SkyBox(SourceMap map, string texturename, Entity light_environment)
        {
            Init(texturename);
            Color4 skyColor = new Color4(2f, 255f, 255f, 255f);

            if (light_environment != null)
            {
                // This makes the skybox blend in better with the rest of the world
                string lightval = light_environment.Values["_light"];
                string[] vals = lightval.Split(' ');
                if (vals.Length == 4)
                {
                    // Try to get sun light color
                    float r, g, b;
                    r = int.Parse(vals[0]);
                    g = int.Parse(vals[1]);
                    b = int.Parse(vals[2]);
                    float brightness = int.Parse(vals[3]);
                    skyColor = new Color4(brightness, r, g, b);
                }
            }

            // Create a tiny lightmap, and take white+ maxExponent from the map as a color
            // Grab brightness of environment light and convert to exponent offset
            tex2 = TextureManager.CreateTexture(1,1,Format.A16B16G16R16F, skyColor);
            SharedTexture2 = true;
        }
开发者ID:maesse,项目名称:CubeHags,代码行数:27,代码来源:SkyBox.cs


示例4: ClearRenderTarget

 public override void ClearRenderTarget(DeviceContext context, Color4 color)
 {
     foreach (RenderTargetView view in renderTargetView)
     {
         context.ClearRenderTargetView(view, color);
     }
 }
开发者ID:nickudell,项目名称:PigmentFramework,代码行数:7,代码来源:MultiRenderTexture.cs


示例5: Clear

 public void Clear(Color4 clearcolor)
 {
     foreach (IDX11RenderTargetView view in this.rtvs)
     {
         this.context.CurrentDeviceContext.ClearRenderTargetView(view.RTV, clearcolor);
     }
 }
开发者ID:hameleon-ed,项目名称:dx11-vvvv,代码行数:7,代码来源:DX11GraphicsRenderer.cs


示例6: Evaluate

        public void Evaluate(int SpreadMax)
        {
            if (this.FInAddressU.IsChanged
                || this.FInAddressV.IsChanged
                || this.FInAddressW.IsChanged
                || this.FInBorderColor.IsChanged
                || this.FInComparison.IsChanged
                || this.FInFilterMode.IsChanged
                || this.FInMaximumAnisotropy.IsChanged
                || this.FInMaximumLod.IsChanged
                || this.FInMinimumLod.IsChanged
                || this.FInMipLodBias.IsChanged)
            {
                this.FOutSampler.SliceCount = 1;
                RGBAColor c = this.FInBorderColor[0];
                Color4 col = new Color4((float)c.R, (float)c.G, (float)c.B, (float)c.A);
                SamplerDescription sampler = new SamplerDescription()
                {
                    AddressU = this.FInAddressU[0],
                    AddressV = this.FInAddressV[0],
                    AddressW = this.FInAddressW[0],
                    BorderColor = col,
                    ComparisonFunction = this.FInComparison[0],
                    Filter = this.FInFilterMode[0],
                    MaximumAnisotropy = this.FInMaximumAnisotropy[0],
                    MaximumLod = this.FInMaximumLod[0],
                    MinimumLod = this.FInMinimumLod[0],
                    MipLodBias = this.FInMipLodBias[0]
                };
                this.FOutSampler.SliceCount = SpreadMax;

                this.FOutSampler[0] = sampler;

            }
        }
开发者ID:koldo4,项目名称:dx11-vvvv,代码行数:35,代码来源:DX11SamplerStateNode.cs


示例7: DrawFullRectangle

        public static ShapeDescription DrawFullRectangle(Vector3 position, Size size, IGradientShader linearShader, Color4 fillColor, Thickness borderSize, BorderStyle borderStyle, Color4 borderColor)
        {
            Color4[] shadedColors = linearShader.Method(linearShader, 4,Shape.Rectangle);
            Color4[] borderColors;

            switch (borderStyle)
            {
                case BorderStyle.None:
                    borderColors = LinearShader.FillColorArray(new Color4(0), 4);
                    break;
                case BorderStyle.Flat:
                    borderColors = LinearShader.FillColorArray(borderColor, 4);
                    break;
                case BorderStyle.Raised:
                    borderColors = LinearShader.BorderRaised(borderColor, 4);
                    break;
                case BorderStyle.Sunken:
                    borderColors = LinearShader.BorderSunken(borderColor, 4);
                    break;
                default:
                    throw new ArgumentOutOfRangeException("borderStyle");
            }
            ShapeDescription inside = DrawRectangle(position, size, shadedColors);
            ShapeDescription outline = DrawRectangularOutline(position, size, borderSize.All, borderColors, borderStyle, Borders.All);

            ShapeDescription result = ShapeDescription.Join(inside, outline);
            result.Shape = Shape.RectangleWithOutline;
            return result;
        }
开发者ID:yong-ja,项目名称:starodyssey,代码行数:29,代码来源:ShapeCreator.Rectangle.cs


示例8: RenderRectangle

 /**
  * Draws a rectangle
  */
 internal void RenderRectangle(int x, int y, int width, int height, Color4 color)
 {
     RenderLine(x, y, color, x + width, y, color);
     RenderLine(x + width, y, color, x + width, y + height, color);
     RenderLine(x + width, y + height, color, x, y + height, color);
     RenderLine(x, y + height, color, x, y, color);
 }
开发者ID:sea-reel,项目名称:DirectX-2D-Mini-Engine,代码行数:10,代码来源:UIRenderer.cs


示例9: DrawBox

        public override void DrawBox(ref Vector3 bbMin, ref Vector3 bbMax, Color4 color)
        {
            var p1 = bbMin;
            var p2 = new Vector3(bbMax.X, bbMin.Y, bbMin.Z);
            var p3 = new Vector3(bbMax.X, bbMax.Y, bbMin.Z);
            var p4 = new Vector3(bbMin.X, bbMax.Y, bbMin.Z);
            var p5 = new Vector3(bbMin.X, bbMin.Y, bbMax.Z);
            var p6 = new Vector3(bbMax.X, bbMin.Y, bbMax.Z);
            var p7 = bbMax;
            var p8 = new Vector3(bbMin.X, bbMax.Y, bbMax.Z);

            int intColor = color.ToArgb();
            PositionColored[] vertices = new PositionColored[] {
                new PositionColored(p1, intColor), new PositionColored(p2, intColor),
                new PositionColored(p2, intColor), new PositionColored(p3, intColor),
                new PositionColored(p3, intColor), new PositionColored(p4, intColor),
                new PositionColored(p4, intColor), new PositionColored(p1, intColor),
                
                new PositionColored(p1, intColor), new PositionColored(p5, intColor),
                new PositionColored(p2, intColor), new PositionColored(p6, intColor),
                new PositionColored(p3, intColor), new PositionColored(p7, intColor),
                new PositionColored(p4, intColor), new PositionColored(p8, intColor),
                
                new PositionColored(p5, intColor), new PositionColored(p6, intColor),
                new PositionColored(p6, intColor), new PositionColored(p7, intColor),
                new PositionColored(p7, intColor), new PositionColored(p8, intColor),
                new PositionColored(p8, intColor), new PositionColored(p5, intColor),
            };

            device.DrawUserPrimitives(PrimitiveType.LineList, 12, vertices);
        }
开发者ID:raiker,项目名称:BulletSharp,代码行数:31,代码来源:PhysicsDebugDraw.cs


示例10: DrawLine

 public override void DrawLine(ref Vector3 from, ref Vector3 to, Color4 fromColor, Color4 toColor)
 {
     PositionColored[] vertices = new PositionColored[2];
     vertices[0] = new PositionColored(from, fromColor.ToArgb());
     vertices[1] = new PositionColored(to, toColor.ToArgb());
     device.DrawUserPrimitives(PrimitiveType.LineList, 1, vertices);
 }
开发者ID:raiker,项目名称:BulletSharp,代码行数:7,代码来源:PhysicsDebugDraw.cs


示例11: ClearTarget

 internal void ClearTarget()
 {
     DayWatch watch = DayWatch.Now;
     BackgroundColor = Color4.Lerp(new Color4(0.8f, 0.8f, 1f), new Color4(0f, 0f, 0f), 1f - watch.SunHeight);
     device.ImmediateContext.ClearRenderTargetView(renderView, BackgroundColor);
     device.ImmediateContext.ClearDepthStencilView(depthView, DepthStencilClearFlags.Depth, 1.0f, 0);
 }
开发者ID:samuto,项目名称:HelloWorld,代码行数:7,代码来源:GlobalRenderer.cs


示例12: VertexPositonNormalColorTexture

 public VertexPositonNormalColorTexture(Vector3 Position, Vector3 normal, Color4 Color, Vector2 texcoords)
 {
     this.Position = Position;
     this.Color = Color.ToArgb();
     this.texcoords = texcoords;
     this.Normal = normal;
 }
开发者ID:maesse,项目名称:CubeHags,代码行数:7,代码来源:VertexPositonNormalColorTexture.cs


示例13: RadialManual

        public static Color4[] RadialManual(GradientStop[] gradient, int numVertex, int offsetIndex)
        {
            Color4[] colors = new Color4[numVertex];
            for (int i = 0; i < numVertex; i++)
                colors[i] = gradient[offsetIndex].Color;

            return colors;
        }
开发者ID:yong-ja,项目名称:starodyssey,代码行数:8,代码来源:RadialShader.cs


示例14: DrawContactPoint

 public override void DrawContactPoint(ref Vector3 pointOnB, ref Vector3 normalOnB, float distance, int lifeTime, Color4 color)
 {
     int intColor = color.ToArgb();
     PositionColored[] vertices = new PositionColored[2];
     vertices[0] = new PositionColored(pointOnB, intColor);
     vertices[1] = new PositionColored(pointOnB + normalOnB, intColor);
     device.DrawUserPrimitives(PrimitiveType.LineList, 1, vertices);
 }
开发者ID:raiker,项目名称:BulletSharp,代码行数:8,代码来源:PhysicsDebugDraw.cs


示例15: CreateBox

        public static VertexPositionColor[] CreateBox(Vector3 mins, Vector3 maxs, Color4 color)
        {
            VertexPositionColor[] verts = new VertexPositionColor[36];

            // Front face
            verts[0] = new VertexPositionColor(new Vector3(mins.X, maxs.Y, maxs.Z), color);
            verts[1] = new VertexPositionColor(new Vector3(mins.X, mins.Y, maxs.Z), color);
            verts[2] = new VertexPositionColor(new Vector3(maxs.X, maxs.Y, maxs.Z), color);
            verts[3] = new VertexPositionColor(new Vector3(mins.X, mins.Y, maxs.Z), color);
            verts[4] = new VertexPositionColor(new Vector3(maxs.X, mins.Y, maxs.Z), color);
            verts[5] = new VertexPositionColor(new Vector3(maxs.X, maxs.Y, maxs.Z), color);

            // Back face (remember this is facing *away* from the camera, so vertices should be
            //    clockwise order)
            verts[6] = new VertexPositionColor(new Vector3(mins.X, maxs.Y, mins.Z), color);
            verts[7] = new VertexPositionColor(new Vector3(maxs.X, maxs.Y, mins.Z), color);
            verts[8] = new VertexPositionColor(new Vector3(mins.X, mins.Y, mins.Z), color);
            verts[9] = new VertexPositionColor(new Vector3(mins.X, mins.Y, mins.Z), color);
            verts[10] = new VertexPositionColor(new Vector3(maxs.X, maxs.Y, mins.Z), color);
            verts[11] = new VertexPositionColor(new Vector3(maxs.X, mins.Y, mins.Z), color);

            // Top face
            verts[12] = new VertexPositionColor(new Vector3(mins.X, maxs.Y, maxs.Z), color);
            verts[13] = new VertexPositionColor(new Vector3(maxs.X, maxs.Y, mins.Z), color);
            verts[14] = new VertexPositionColor(new Vector3(mins.X, maxs.Y, mins.Z), color);
            verts[15] = new VertexPositionColor(new Vector3(mins.X, maxs.Y, maxs.Z), color);
            verts[16] = new VertexPositionColor(new Vector3(maxs.X, maxs.Y, maxs.Z), color);
            verts[17] = new VertexPositionColor(new Vector3(maxs.X, maxs.Y, mins.Z), color);

            // Bottom face (remember this is facing *away* from the camera, so vertices should be
            //    clockwise order)
            verts[18] = new VertexPositionColor(new Vector3(mins.X, mins.Y, maxs.Z), color);
            verts[19] = new VertexPositionColor(new Vector3(mins.X, mins.Y, mins.Z), color);
            verts[20] = new VertexPositionColor(new Vector3(maxs.X, mins.Y, mins.Z), color);
            verts[21] = new VertexPositionColor(new Vector3(mins.X, mins.Y, maxs.Z), color);
            verts[22] = new VertexPositionColor(new Vector3(maxs.X, mins.Y, mins.Z), color);
            verts[23] = new VertexPositionColor(new Vector3(maxs.X, mins.Y, maxs.Z), color);

            // Left face
            verts[24] = new VertexPositionColor(new Vector3(mins.X, maxs.Y, maxs.Z), color);
            verts[25] = new VertexPositionColor(new Vector3(mins.X, mins.Y, mins.Z), color);
            verts[26] = new VertexPositionColor(new Vector3(mins.X, mins.Y, maxs.Z), color);

            verts[27] = new VertexPositionColor(new Vector3(mins.X, maxs.Y, mins.Z), color);
            verts[28] = new VertexPositionColor(new Vector3(mins.X, mins.Y, mins.Z), color);
            verts[29] = new VertexPositionColor(new Vector3(mins.X, maxs.Y, maxs.Z), color);

            // Right face (remember this is facing *away* from the camera, so vertices should be
            //    clockwise order)
            verts[30] = new VertexPositionColor(new Vector3(maxs.X, maxs.Y, maxs.Z), color);
            verts[31] = new VertexPositionColor(new Vector3(maxs.X, mins.Y, maxs.Z), color);
            verts[32] = new VertexPositionColor(new Vector3(maxs.X, mins.Y, mins.Z), color);
            verts[33] = new VertexPositionColor(new Vector3(maxs.X, maxs.Y, mins.Z), color);
            verts[34] = new VertexPositionColor(new Vector3(maxs.X, maxs.Y, maxs.Z), color);
            verts[35] = new VertexPositionColor(new Vector3(maxs.X, mins.Y, mins.Z), color);

            return verts;
        }
开发者ID:maesse,项目名称:CubeHags,代码行数:58,代码来源:MiscRender.cs


示例16: RenderService

 public RenderService()
 {
     bitmaps = new Dictionary<string, Bitmap>();
     brushes = new Dictionary<Tuple<Color4, float>, SolidColorBrush>();
     writeFactory = new SlimDX.DirectWrite.Factory(SlimDX.DirectWrite.FactoryType.Shared);
     clearColor = new Color4(1, 1, 1);
     PixelFormat pixelFormat = new PixelFormat(SlimDX.DXGI.Format.B8G8R8A8_UNorm, AlphaMode.Premultiplied);
     bitmapProperties = new BitmapProperties() { PixelFormat = pixelFormat };
 }
开发者ID:kinectitude,项目名称:kinectitude,代码行数:9,代码来源:RenderService.cs


示例17: FromColor

 public static Color4 FromColor(Color color)
 {
   Color4 v = new Color4(color.A, color.R, color.G, color.B);
   v.Alpha /= 255.0f;
   v.Red /= 255.0f;
   v.Green /= 255.0f;
   v.Blue /= 255.0f;
   return v;
 }
开发者ID:HAF-Blade,项目名称:MediaPortal-2,代码行数:9,代码来源:ColorConverter.cs


示例18: FontString

 /// <summary>
 /// Initializes a new instance of the <see cref="FontString" /> struct.
 /// </summary>
 /// <param name="text">The text.</param>
 /// <param name="textBox">The text box.</param>
 /// <param name="alignment">The font alignment.</param>
 /// <param name="fontSize">Size of the font.</param>
 /// <param name="colour">The colour.</param>
 /// <param name="kerning">if set to <c>true</c> [kerning].</param>
 public FontString(string text, Rect textBox, Alignment alignment, float fontSize, Color4 colour, bool kerning)
 {
     Text = text;
     TextBox = textBox;
     Alignment = alignment;
     FontSize = fontSize;
     Colour = colour;
     Kerning = kerning;
 }
开发者ID:nickudell,项目名称:PigmentFramework,代码行数:18,代码来源:FontChar.cs


示例19: MaterialBuffer

 public MaterialBuffer(float kA, float kD, float kS, float sP, Color4 ambient, Color4 diffuse, Color4 specular)
 {
     this.kA = kA;
     this.kD= kD;
     this.kS= kS;
     this.sPower= sP;
     Ambient = ambient;
     Diffuse = diffuse;
     Specular = specular;
 }
开发者ID:yong-ja,项目名称:starodyssey,代码行数:10,代码来源:MaterialBuffer.cs


示例20: Quad

 /// <summary>
 /// Initializes a new instance of the <see cref="Quad" /> class.
 /// </summary>
 /// <param name="x">The x coordinate of the upper-left vertex.</param>
 /// <param name="y">The y coordinate of the upper-left vertex.</param>
 /// <param name="screenWidth">Width of the screen.</param>
 /// <param name="screenHeight">Height of the screen.</param>
 /// <param name="textureFileName">Path to the texture file.</param>
 /// <param name="width">The width of the quad.</param>
 /// <param name="height">The height of the quad.</param>
 /// <param name="colour">The colour to blend this quad's texture with.</param>
 public Quad(int x, int y, int screenWidth, int screenHeight, string textureFileName, int width, int height, Color4 colour)
 {
     this.position = new Vector2Int(x, y);
     this.screenDimensions = new Vector2Int(screenWidth, screenHeight);
     this.width = width;
     this.height = height;
     this.Colour = colour;
     TexturePath = textureFileName;
     vertices = buildVertices();
     indices = buildIndices();
 }
开发者ID:nickudell,项目名称:PigmentFramework,代码行数:22,代码来源:Quad.cs



注:本文中的SlimDX.Color4类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Direct3D11.Buffer类代码示例发布时间:2022-05-26
下一篇:
C# Service.WorkflowService类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap