Colour percentage in Bitmap

后端 未结 1 1738
眼角桃花
眼角桃花 2020-12-22 04:09

Started without knowing about bitmap**

To get total pixels in bitmap  height*Width 
To get total white pixels Where R==255 & B==255 & G==255         


        
相关标签:
1条回答
  • 2020-12-22 04:22

    I have found myself, for viewers convenience for re usage, adding the correction(Question is updated with the answer already).

    To get total pixels use image dimensions, instead of counting the looping pixels in bitlockdata.

    Image page= new Image(filePath);
    double nTotal = page.Width * page.Height;
    
    0 讨论(0)
提交回复
热议问题