protected virtual void OnRawImage(FileRawImageEventArgs args) { FileRawImageEventHandler handler = FileRawImage; if (handler != null) { ISynchronizeInvoke target = handler.Target as ISynchronizeInvoke; if (target != null && target.InvokeRequired) { target.Invoke(handler, new object[] { this, args }); } else { handler(this, args); } } }
void tool_FileRawImage(object sender, FileRawImageEventArgs e) { atlasElementsCountIntToolStripLabel.Text = e.AtlasElements.Count.ToString(); atlasElementsListToolStripComboBox.ComboBox.SelectedIndex = -1; atlasElementsListToolStripComboBox.ComboBox.Items.Clear(); graphicsPath = null; atlasElementsListToolStripComboBox.Enabled = atlasElementBorderColors.Enabled = false; atlasElementWidthToolStrip.Text = atlasElementHeightToolStrip.Text = atlasElementXToolStrip.Text = atlasElementYToolStrip.Text = "0"; if (e.AtlasElements.Count > 0) { graphicsPath = new GraphicsPath(); atlasElementsListToolStripComboBox.Enabled = atlasElementBorderColors.Enabled = true; foreach (KleiTextureAtlasElement el in e.AtlasElements) { atlasElementsListToolStripComboBox.Items.Add(el); } } imageBox.Image = e.Image; zoomLevelToolStripComboBox.Text = string.Format("{0}%", imageBox.Zoom); }