private void RefreshAdapter() { IPictureDecoder decoder = document.CurrentResource.Format.Decoder as IPictureDecoder; if (decoder == null) { document.CurrentResource.Format.Code = "Direct"; decoder = document.CurrentResource.Format.Decoder as IPictureDecoder; } if (picture != null) { picture.Changed -= new EventHandler(Format_Changed); } var old = picture; picture = new PictureAdapter(decoder); picture.Data = document.Data; picture.PicOffset = document.CurrentResource.Offset; if (old != null) { picture.Zoom = old.Zoom; } if (decoder is INeedsPalette) { ((INeedsPalette)decoder).Palette = palette; } picture.Changed += new EventHandler(Format_Changed); Format_Changed(picture, EventArgs.Empty); }
public PictureAdapter(IPictureDecoder decoder) { this.decoder = decoder; this.pictureControl = decoder as IPictureDecoderController; if (this.pictureControl != null) { this.pictureControl.Changed += decoder_Changed; } }
public PictureAdapter(IPictureDecoder decoder) { this.decoder = decoder; this.pictureControl = decoder as IPictureDecoderController; if (this.pictureControl != null) { this.pictureControl.Changed += decoder_Changed; } }