c# - GetPixel always return 0 on png image -


when read image getpixel() color value black. image png image.

i tried convert image bitmap before, don't had success.

i believe problem isn't code, because whether open png image in paint , save it. code read image correctly.

i load image bellow

myimage = new bitmap(filename); 

i need read image here

private void loadimagemap(bitmap value){         (int col = 0; col < value.width; col++)         {             (int row = 0; row < value.height; row++)             {                 var color = value.getpixel(col, row); 

var color black, always.

sample of image...

since passed in bitmap code, need use variable when calling getpixel. also, ref keyword not needed in case.

private void loadimagemap(bitmap value) {     (int col = 0; col < value.width; col++)     {         (int row = 0; row < value.height; row++)         {             var color = value.getpixel(col, row);         }     } } 

Comments

Popular posts from this blog

What is happening when Matlab is starting a "parallel pool"? -

angular - DownloadURL return null in below code -

php - Cannot override Laravel Spark authentication with own implementation -