c# - How to implement a conical/cone/circular gradient in WPF -


I want to recreate a conical / circular gradient in WPF. I have seen in the inheritance system. Windows.media Gradientbrish - which can be inherited - many internal pipelines are used to work on (system meets .windows media.brush)

How to obtain a

Cheers

Donation

This question was recalled some time back (July) but I would have appreciated the idea (without interaction without bitmap) Did not want to reproduce an old question.

You can create a custom effect. I recommend download, you also need DirectX SDK Will be. Give the element a horizontal gradient, then apply it to turn it into a cone slope.

  /// & lt; Class & gt; Anggladient & lt; / Class & gt; /// & lt; Details & gt; Presents an angle shield. & Lt; / Description & gt; // ------------------------------------------------ ----------------------------------------- // Shader Continuous Register Mapping (Scalaras - Float, double, point, color, point 3D, etc.) ---------------------------------- - ------------------------------------------------- - ---- /// & lt; Summary & gt; Center of shield & Lt; / Summary & gt; /// & lt; MinValue & gt; 0 & lt; / MinValue & gt; /// & lt; MaxValue & gt; 1 & lt; / MaxValue & gt; /// & lt; Default value & gt; 0.5.0.5 & lt; / DefaultValue & gt; Float2 Center: Register (C); /// & lt; Summary & gt; Start angle & Lt; / Summary & gt; /// & lt; MinValue & gt; 0 & lt; / MinValue & gt; /// & lt; MaxValue & gt; 1 & lt; / MaxValue & gt; /// & lt; Default value & gt; 0 & lt; / DefaultValue & gt; Float angle: register (c1); // ------------------------------------------------ -------------------------------------- // Sampler input (Brushed, with implicit input) / / ------------------------------------------------- - ------------------------------------ Sample 1D inputsmailer: Register (s); Static Const float PI = 3.14159265 f; // ------------------------------------------------ -------------------------------------- // Pixel Shader // ------ -------------------------------------------------- ------------------------------ float4 main (float2 uv: TEXCOORD): color {float angle = atan2 (uv.y- Center.Y, uv.x-Center.x) + PI; Angle = (angle / (2 * pi) + angle; Return tex1D (built-in inputs, minimum (angle & gt; 1? Angle-1: angle, 0.99));  

Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -