public virtual void WritePicture(string fileName, BitArray data) { PixelPicture original = writerReader.GetContainer(); picture = new PixelPicture(new Bitmap(original.GetPicture())); writerReader.GetBlock().SetContainer(picture); FillPicture(); ToBegin(); byte[] nameBytes = BitByte.BytesFromString(fileName); WriteDataInContainer(BitByte.BitsFromInt(nameBytes.Length)); BitArray array = BitByte.BytesToBits(nameBytes); WriteDataInContainer(BitByte.BytesToBits(nameBytes)); WriteDataInContainer(BitByte.BitsFromInt(data.Length / 8 + (data.Length % 8 == 0 ? 0 : 1))); WriteDataInContainer(data); writerReader.GetBlock().SetContainer(original); }
protected override void OnShown(EventArgs e) { _application = new SampleApplication(this); _picture = new PixelPicture { Width = 16, Height = 16 }; _scriptEnvironment = new SampleScriptEnvironment(logTextBox); _scriptEnvironment.AddType("color", typeof(Color)); _scriptEnvironment.AddValue("picture", _picture); _scriptEnvironment.AddValue("application", _application); base.OnShown(e); this.ProcessCommandLine(); }
public void SetContainer(PixelPicture container) { this.container = container; }