Grayscale ColorMatrix Difference

  • Thread starter Thread starter Henry Wu
  • Start date Start date
H

Henry Wu

Hi I was at the search for making e.Graphics.DrawImage turn any image
to Grayscale, and I found two similar solutions but different
ColorMatrix values, what is the difference between the two? Is there
an industry standard for the GrayScale ColorMatrix values?

Thanks,
Henry

Solution #1, Jacob Grass:

http://groups.google.com.ph/groups?...3395&seekm=uLXNhTJhBHA.1644@tkmsftngp05#link3

Dim GrayShear()() As Single = New Single()() _
{New Single(4) {0.5, 0.5, 0.5, 0, 0}, _
New Single(4) {0.5, 0.5, 0.5, 0, 0}, _
New Single(4) {0.5, 0.5, 0.5, 0, 0}, _
New Single(4) {0, 0, 0, 1, 0}, _
New Single(4) {0, 0, 0, 0, 1}}


Solution #2, Bob Powell:

http://groups.google.com.ph/groups?...m=#[email protected]#link4

Dim cm As ColorMatrix = New ColorMatrix(New Single()() _
{New Single() {0.3, 0.3, 0.3, 0, 0}, _
New Single() {0.59, 0.59, 0.59, 0, 0}, _
New Single() {0.11, 0.11, 0.11, 0, 0}, _
New Single() {0, 0, 0, 1, 0}, _
New Single() {0, 0, 0, 0, 1}})


These are just portions of the code, I just copied and pasted the
Grayscale ColorMatrix values and they differ from one another.
 
Thanks again Dr. ScrewUp,

I finally got the Magnifier working the way I want it.
http://wuhenry.beigetower.org/MagnifierXP-Final.zip

You remember the seperate repaint function you made, that did the
trick for it to not flicker, even when I remove the mouse monitoring
variables, it does not flicker at all. As long as I don't call any
Invalidate :)

Thanks so much,
Henry
 
Back
Top