public void DrawImage(double x, double y, double w, double h, PictureObjectModel picture) { if (picture == null) { return; } if (!_texturesByPicture.ContainsKey(picture)) { Texture _texture = Texture.FromPicture(picture); _texturesByPicture.Add(picture, _texture); } DrawImage(x, y, w, h, _texturesByPicture[picture]); }
public MenuItem Add(string name, string text = null, PictureObjectModel image = null, bool visible = true, bool enabled = true) { if (text == null) { text = name; } MenuItem item = new MenuItem(); item.Name = name; item.Text = text; item.Image = image; item.Visible = visible; item.Enabled = enabled; Add(item); return(item); }
private void FileOpen_Click(object sender, EventArgs e) { picObj = new UniversalEditor.ObjectModels.Multimedia.Picture.PictureObjectModel(); OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = UniversalEditor.Common.Dialog.GetCommonDialogFilter(picObj.MakeReference()); if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { UniversalEditor.Common.Reflection.GetAvailableObjectModel <UniversalEditor.ObjectModels.Multimedia.Picture.PictureObjectModel>(ofd.FileName, ref picObj); Bitmap bmp = picObj.ToBitmap(); pic.Image = bmp; Text = System.IO.Path.GetFileName(ofd.FileName) + " - Caltron Image Viewer"; } }
private void FileOpen_Click(object sender, EventArgs e) { picObj = new UniversalEditor.ObjectModels.Multimedia.Picture.PictureObjectModel(); OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = UniversalEditor.Common.Dialog.GetCommonDialogFilter(picObj.MakeReference()); if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { UniversalEditor.Common.Reflection.GetAvailableObjectModel<UniversalEditor.ObjectModels.Multimedia.Picture.PictureObjectModel>(ofd.FileName, ref picObj); Bitmap bmp = picObj.ToBitmap(); pic.Image = bmp; Text = System.IO.Path.GetFileName(ofd.FileName) + " - Caltron Image Viewer"; } }
public static Texture FromPicture(PictureObjectModel pic, TextureRotation rotation, TextureFlip flip) { if (texturesByPicture.ContainsKey(pic)) { Texture tex = texturesByPicture[pic]; tex.Rotation = rotation; tex.Flip = flip; return(tex); } uint[] textureIDs = new uint[1]; Internal.OpenGL.Methods.glGenTextures(1, textureIDs); Internal.OpenGL.Methods.glErrorToException(); uint textureID = textureIDs[0]; Texture texture = new Texture(textureID); texture.Target = TextureTarget.Texture2D; texture.TextureImage = pic; texture.MinFilter = TextureFilter.Linear; texture.MagFilter = TextureFilter.Linear; texture.TextureWrapR = TextureWrap.Repeat; texture.TextureWrapS = TextureWrap.Repeat; texture.TextureWrapT = TextureWrap.Repeat; texture.Rotation = rotation; texture.Flip = flip; if (!texturesByID.ContainsKey(textureID)) { texturesByID.Add(textureID, texture); } if (!texturesByPicture.ContainsKey(pic)) { texturesByPicture.Add(pic, texture); } return(texture); }
public static Texture FromPicture(PictureObjectModel pic, TextureRotation rotation, TextureFlip flip) { if (texturesByPicture.ContainsKey(pic)) { Texture tex = texturesByPicture[pic]; tex.Rotation = rotation; tex.Flip = flip; return(tex); } uint[] textureIDs = Engine.GetDefault().GenerateTextureIDs(1); uint textureID = textureIDs[0]; Texture texture = new Texture(textureID); texture.Target = TextureTarget.Texture2D; texture.TextureImage = pic; texture.MinFilter = TextureFilter.Linear; texture.MagFilter = TextureFilter.Linear; texture.TextureWrapR = TextureWrap.Repeat; texture.TextureWrapS = TextureWrap.Repeat; texture.TextureWrapT = TextureWrap.Repeat; texture.Rotation = rotation; texture.Flip = flip; if (!texturesByID.ContainsKey(textureID)) { texturesByID.Add(textureID, texture); } if (!texturesByPicture.ContainsKey(pic)) { texturesByPicture.Add(pic, texture); } return(texture); }
public static Texture FromPicture(PictureObjectModel pic) { return(FromPicture(pic, TextureRotation.None, TextureFlip.None)); }
public Image(PictureObjectModel picture) { mvarPicture = picture; }
public static Texture FromPicture(PictureObjectModel pic, TextureRotation rotation, TextureFlip flip) { if (texturesByPicture.ContainsKey(pic)) { Texture tex = texturesByPicture[pic]; tex.Rotation = rotation; tex.Flip = flip; return tex; } uint[] textureIDs = new uint[1]; Internal.OpenGL.Methods.glGenTextures(1, textureIDs); Internal.OpenGL.Methods.glErrorToException(); uint textureID = textureIDs[0]; Texture texture = new Texture(textureID); texture.Target = TextureTarget.Texture2D; texture.TextureImage = pic; texture.MinFilter = TextureFilter.Linear; texture.MagFilter = TextureFilter.Linear; texture.TextureWrapR = TextureWrap.Repeat; texture.TextureWrapS = TextureWrap.Repeat; texture.TextureWrapT = TextureWrap.Repeat; texture.Rotation = rotation; texture.Flip = flip; if (!texturesByID.ContainsKey(textureID)) { texturesByID.Add(textureID, texture); } if (!texturesByPicture.ContainsKey(pic)) { texturesByPicture.Add(pic, texture); } return texture; }
public static Texture FromPicture(PictureObjectModel pic) { return FromPicture(pic, TextureRotation.None, TextureFlip.None); }