Algorithm of bitmap getbrightness() in C# -


I want to implement the function in Java which calculates the brightness of the color similar to the brightness () function that will get C # is. So I need to know the exact algorithm which was used in C #. There are some algorithms but 5% of them have errors.

Use the official source: Public Float GetBrightness () {Float R = (float) R / 255.0F; Float G = (Float) G / 255.0F; Float B = (Float) B / 255.0F; Float Max, Min; Max = r; Min = r; If (g> maximum) max = g; If (b> max) max = b; If (G & lt; minutes) minimum = g; If (B & l; minutes) minutes = B; Return (max + min) / 2; }

Comments

Popular posts from this blog

python - Writing Greek in matplotlib labels, titles -

c# - LINQ to Entities does not recognize the method 'Int32 IndexOf(System.String, System.StringComparison)' method -

Pygame memory leak with transform.flip -