Anyone know whats this problem?
I got this warning Field xxx is never assigned to, and will always have its default value null on private sta
You are never assigning an instance of the Quantizer
class to your quantit
static variable, so it will remain a null
reference and will generate that exception when you'll try to use one of its methods. To fix the problem, just initialize that member with a new Quantizer
object before using it.
By the way, I'm not sure you want that variable to be static
.
Edit
I saw just now that Quantizer
is an abstract class... then you can't instantiate it directly, you have first to derive your specific class from it implementing the abstract
methods (namely QuantizePixel
and GetPalette
) or use another ready-made class deriving from Quantizer
, and then initialize the quantit
field with a new instance of such class.