Пример #1
0
 public MenuObject(TextureObject texture)
 {
     textureObject = texture;
     posX          = 0;
     posY          = 0;
     streach       = 1.0f;
 }
Пример #2
0
        private void RightPanelAddTextureObject(object sender, RoutedEventArgs e)
        {
            OpenFileDialog myDialog = new OpenFileDialog();

            myDialog.Filter          = "Картинки(*.JPG;*.GIF;*.PNG)|*.JPG;*.GIF;*.PNG" + "|Все файлы (*.*)|*.* ";
            myDialog.CheckFileExists = true;
            myDialog.Multiselect     = true;
            if (myDialog.ShowDialog() == true)
            {
                foreach (string fiilename in myDialog.FileNames)
                {
                    TextureObject texobj = new TextureObject();
                    texobj.ImagePath = new Uri(fiilename, UriKind.Absolute);
                    if (texobj.ImagePath.IsFile)
                    {
                        texobj.Name = System.IO.Path.GetFileNameWithoutExtension(texobj.ImagePath.LocalPath);
                    }
                    TextureObjects.Add(texobj);
                }
            }
        }
Пример #3
0
        private void Image_MouseDown(object sender, MouseButtonEventArgs e)
        {
            image = e.Source as Image;
            ListBox     lb  = FindParent <ListBox>(image);
            ListBoxItem lbi = FindParent <ListBoxItem>(image);

            ((ListBoxItem)lbi).IsSelected = true;
            selectedTextureObject         = (TextureObject)lb.SelectedItem;

            if (selectedTextureObject != null)
            {
                textBox.Text = selectedTextureObject.Name;
            }
            else
            {
                textBox.Text = "NULL";
            }
            //textBox.Text = selectedTextureObject.ImagePath.ToString();
            CreateDragDropWindow(image);
            DataObject data = new DataObject(typeof(ImageSource), image.Source);

            DragDrop.DoDragDrop(image, data, DragDropEffects.Copy);
        }
Пример #4
0
 private void RightPanelLB_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     selectedTextureObject = (TextureObject)RightPanelLB.SelectedItem;
 }