谁知道这个问题是什么?
我得到这个警告现场XXX永远不会分配给,永远有它的默认值零上private static Quantizer quantit;
我不知道该怎么做才能修复,因为当我尝试使用quantit.Quantize()
debug时说:"对象引用未设置为对象的实例." 并指向au = quantit.Quantize();
代码:
public class Quantization : System.Windows.Forms.Form
{
private static Quantizer quantit;
private Button btnLoad;
private PictureBox imgPhoto;
public Quantization()
{
btnLoad = new Button();
btnLoad.Text = "&Load";
btnLoad.Left = 10;
btnLoad.Top = 10;
btnLoad.Click += new System.EventHandler(this.OnLoadClick);
imgPhoto = new PictureBox();
imgPhoto.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
imgPhoto.Width = this.Width / 2;
imgPhoto.Height = this.Height / 2;
imgPhoto.Left = (this.Width - imgPhoto.Width) / 2;
imgPhoto.Top = …
Run Code Online (Sandbox Code Playgroud)