private void DrawFailureSplash(string message) { var graphics = _textOverlay.GetDrawableGraphicsContext(); if (graphics == null) { return; } var format = new StringFormat { LineAlignment = StringAlignment.Center, Alignment = StringAlignment.Center }; // hack: re-use the image we use for failed texture imports :-) var img = TextureThumbnailControl.GetLoadErrorImage(); graphics.DrawImage(img, GlControl.Width / 2 - img.Width / 2, GlControl.Height / 2 - img.Height - 30, img.Width, img.Height); graphics.DrawString("Sorry, this scene failed to load.", Window.UiState.DefaultFont16, new SolidBrush(Color.Red), new RectangleF(0, 0, GlControl.Width, GlControl.Height), format); graphics.DrawString("What the importer said went wrong: " + message, Window.UiState.DefaultFont12, new SolidBrush(Color.Black), new RectangleF(0, 100, GlControl.Width, GlControl.Height), format); }
public void SetTexture(TextureThumbnailControl tex) { Debug.Assert(tex != null && tex.Texture != null); _tex = tex; var img = tex.Texture.Image; Text = Path.GetFileName(tex.FilePath) + " - Details"; pictureBox1.Image = img; labelInfo.Text = string.Format("Size: {0} x {1} px", img.Width, img.Height); checkBoxHasAlpha.Checked = tex.Texture.HasAlpha == Texture.AlphaState.HasAlpha; pictureBox1.SizeMode = PictureBoxSizeMode.Zoom; }