示例#1
0
        public FontEditorViewModel(FontsArc fonts)
        {
            _fonts = fonts;
            Fonts  = new[]
            {
                new FontEntryViewModel(fonts.FontCmd),
                new FontEntryViewModel(fonts.FontHelp),
                new FontEntryViewModel(fonts.FontMenu),
                new FontEntryViewModel(fonts.FontMes),
                new FontEntryViewModel(fonts.FontNumeral)
            };

            DrawingContext = new SpriteDrawingDirect3D();
            DrawBegin      = new RelayCommand(_ =>
            {
                if (_selectedFont?.Font1 == null ||
                    SelectedCharacter == null)
                {
                    return;
                }

                if (_surface1 == null)
                {
                    CreateFontSurfaces();
                }

                if (_surface1 == null)
                {
                    return;
                }

                DrawingContext.Clear(new ColorF(0.0f, 0.0f, 0.0f, 1.0f));
                PrintCharacter(SelectedCharacter);
                DrawingContext.Flush();
            });
        }
示例#2
0
 public CtdDrawHandler()
 {
     DrawingContext = new SpriteDrawingDirect3D();
 }