当前位置: 首页>>代码示例>>C#>>正文


C# BufferedGraphicsContext.Allocate方法代码示例

本文整理汇总了C#中System.Drawing.BufferedGraphicsContext.Allocate方法的典型用法代码示例。如果您正苦于以下问题:C# BufferedGraphicsContext.Allocate方法的具体用法?C# BufferedGraphicsContext.Allocate怎么用?C# BufferedGraphicsContext.Allocate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Drawing.BufferedGraphicsContext的用法示例。


在下文中一共展示了BufferedGraphicsContext.Allocate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: frmPathFinderDemo_Load

        private void frmPathFinderDemo_Load(object sender, EventArgs e)
        {
            m_blnIsLoading = true;
            m_blnMouseDown = false;

            mGraphContext = BufferedGraphicsManager.Current;

            mBuffer1 = mGraphContext.Allocate(pnlViewPort.CreateGraphics(), pnlViewPort.DisplayRectangle);
            mBuffer1.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
            mBuffer1.Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit;

            m_Pathfinder = new PathFinder();
            m_Pathfinder.InitialiseGraph(CELLS_UP, CELLS_DOWN, pnlViewPort.Width, pnlViewPort.Height);
            m_Pathfinder.InitialiseSourceTargetIndexes();

            m_Pathfinder.ShowGraph = MenuGraph.Checked;
            m_Pathfinder.ShowTiles = MenuTiles.Checked;

            m_intMouseGridIndex = -1;
            ResetButtonAlgos();

            m_Pathfinder.CurrentTerrainBrush = GetButtonTerrainBrush();

            ReDraw();

            m_blnIsLoading = false;
        }
开发者ID:Cloverseer,项目名称:thinksharp,代码行数:27,代码来源:frmPathFinderDemo.cs

示例2: MainForm

        public MainForm()
        {
            InitializeComponent();

            this.currentFileData = new GameData(32, 32);
            this.currentFileName = null;

            this.toolImages = new TextureBrush[7];

            for (int i = 0; i < this.toolImages.Length; i++)
            {
                this.toolImages[i] = new TextureBrush(Image.FromFile("images/" + i + ".png"));
            }

            this.backgroundImage = new TextureBrush(Image.FromFile("images/checkerboard.png"));

            this.selectedTool = 1;

            this.graphicsContext = BufferedGraphicsManager.Current;
            this.graphics = graphicsContext.Allocate(this.StageEditBoard.CreateGraphics(),
                new Rectangle(0, 0, 32 * (int)EDIT_BOARD_SCALING, 32 * (int)EDIT_BOARD_SCALING));

            for(int i = 0; i < MainForm.DIRECTIONS.Length; i++)
                this.StartDirection.Items.Add(DIRECTIONS[i]);

            this.LoadTextureFiles();

            this.FileNew(null, null);
        }
开发者ID:erbuka,项目名称:andrea,代码行数:29,代码来源:MainForm.cs

示例3: frmCogMain

 public frmCogMain()
 {
     InitializeComponent();
       // Create a new Environment
       Graphics g = Graphics.FromHwnd(pnlSimulation.Handle);
       context = BufferedGraphicsManager.Current;
       context.MaximumBuffer = new Size((int)g.VisibleClipBounds.Width + 1, (int)g.VisibleClipBounds.Height + 1);
       grafx = context.Allocate(g, new Rectangle(0, 0, (int)g.VisibleClipBounds.Width, (int)g.VisibleClipBounds.Height));
       this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
       env = new Clockwork.Environment(grafx, imgDrawList, COG_Model.Properties.Settings.Default.NumberOfAgents,
                               (int)COG_Model.Properties.Settings.Default.NumberIterations, (int)COG_Model.Properties.Settings.Default.TimeIteration);
       // Register the events
       env.NewAgent += new Clockwork.Environment.NewAgentCallBack(env_NewAgent);
       env.DeleteAgent += new Clockwork.Environment.DeleteAgentCallBack(env_DeleteAgent);
       env.StatUpdate += new Clockwork.Environment.StatUpdateCallBack(env_StatUpdate);
       env.TimerChange += new Clockwork.Environment.TimerCallBack(env_TimerChange);
       env.Complete += new Clockwork.Environment.CompleteCallBack(env_Complete);
       env.New();
       // Disable the run controls
       btnStop.Enabled = false;
       // Add the Execution plan tree to the display
       executionTree = new ucExecutionTree(ref env);
       executionTree.Dock = DockStyle.Fill;
       spltInfo.Panel2.Controls.Add(executionTree);
 }
开发者ID:stevenandrewcarter,项目名称:COG,代码行数:25,代码来源:FrmCogMain.cs

示例4: InitializeGraphics

 private void InitializeGraphics()
 {
     this.DoubleBuffered = true;
     graphics = mainPictureBox.CreateGraphics();
     bufferedGraphicsContext = new BufferedGraphicsContext();
     bufferedGraphics = bufferedGraphicsContext.Allocate(graphics, new Rectangle(0, 0, mainPictureBox.Width, mainPictureBox.Height));
 }
开发者ID:andyskl,项目名称:cell-auto,代码行数:7,代码来源:MainForm.cs

示例5: OnPaintBackground

 protected override void OnPaintBackground(PaintEventArgs e)
 {
     BufferedGraphicsContext bgc = new BufferedGraphicsContext();
     BufferedGraphics bg = bgc.Allocate(e.Graphics, e.ClipRectangle);
     Draw(bg.Graphics);
     bg.Render();
 }
开发者ID:krikelin,项目名称:SpiderView,代码行数:7,代码来源:AppHead.cs

示例6: MainForm

        public MainForm()
        {
            InitializeComponent();

            _VideoWindow = new VideoWindow();
            _Brush = null;

            shemes = new Shemes();
            tscbShemes.Items.Clear();
            tscbShemes.Items.Add(shemes.GetCurrentShemeName());
            tscbShemes.SelectedIndex = 0;

            LoadLastShemeName();

            if (Program.PauseInsteadOfStop)
                tsmiPauseInsteadStop.Image = Properties.Resources.ok;
            else
                tsmiPauseInsteadStop.Image = null;

            brush = new SolidBrush(BackColor);
            this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true);
            this.Resize += new System.EventHandler(this.OnResize);
            this.Paint += new System.Windows.Forms.PaintEventHandler(this.OnPaint);

            UpdateRect();
            context = BufferedGraphicsManager.Current;
            context.MaximumBuffer = rect.Size;
            grafx = context.Allocate(this.CreateGraphics(), rect);
            DrawToBuffer(grafx.Graphics);

            _Runner = new Thread(Runner);
            _Runner.Start();

            _Loader = new Thread(new ParameterizedThreadStart(LoadTile));
        }
开发者ID:OpenJinglePlayer,项目名称:OpenJinglePlayer,代码行数:35,代码来源:MainForm.cs

示例7: SmoothPanel2

        public SmoothPanel2()
        {
            GraphicManager = BufferedGraphicsManager.Current;
            GraphicManager.MaximumBuffer = new Size(this.Width + 1, this.Height + 1);
            ManagedBackBuffer = GraphicManager.Allocate(this.CreateGraphics(), ClientRectangle);

            //SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);
        }
开发者ID:hpavlov,项目名称:tangra3,代码行数:8,代码来源:SmoothPanel.cs

示例8: GraphicDrawter

        protected BufferedGraphicsContext graphicContext = null; // методы сознания графичечких буферов

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Инициализирует новый экземпляр класса
        /// </summary>
        /// <param name="g">Повехность на которой необходимо выполнять рисование</param>
        /// <param name="FrameToDraw">Область и положение, занимаемое графиком калибровки на форме</param>
        public GraphicDrawter(Graphics g, Rectangle FrameToDraw)
        {
            graphicContext = BufferedGraphicsManager.Current;
            graphicBuffer = graphicContext.Allocate(g, FrameToDraw);

            graphicBuffer.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
            //graphicBuffer.Graphics.PixelOffsetMode = PixelOffsetMode.HighQuality;
        }
开发者ID:slawer,项目名称:sgt,代码行数:19,代码来源:GraphicDrawter.cs

示例9: GraphicForm

 public GraphicForm()
 {
     InitializeComponent();
     pictureBox.BackColor = Color.Gray;
     currentContext = BufferedGraphicsManager.Current;
     myBuffer = currentContext.Allocate(pictureBox.CreateGraphics(), pictureBox.DisplayRectangle);
     this.graphic = myBuffer.Graphics;
     pen = new Pen(Color.Gold);
     figureList = new List<Figure>();
 }
开发者ID:vitiaaap29,项目名称:oop_lab_1,代码行数:10,代码来源:GraphicForm.cs

示例10: VideoScreen

        public VideoScreen()
        {
            bufferContext = BufferedGraphicsManager.Current;
            width = Width;
            height = Height;
            bg = bufferContext.Allocate(CreateGraphics(), new Rectangle(0, 0, Width, Height));
            g = bg.Graphics;

            InitializeComponent();
        }
开发者ID:krisives,项目名称:GRemote,代码行数:10,代码来源:VideoScreen.cs

示例11: ProgressBarEx

 public ProgressBarEx()
     : base()
 {
     _context = BufferedGraphicsManager.Current;
     _context.MaximumBuffer = new Size(Width+1, Height+1);
     _bufferedGraphics = _context.Allocate(
         CreateGraphics(),
         new Rectangle(Point.Empty, Size));
     SetRegion();
 }
开发者ID:songques,项目名称:CSSIM_Solution,代码行数:10,代码来源:ProgressBarEx.cs

示例12: DrawingSystem

 public DrawingSystem(Form form, EntityManager manager)
     : base(manager)
 {
     _form = form;
     _form.Invoke(new Action(() =>
     {
         _context = BufferedGraphicsManager.Current;
         _buffer = _context.Allocate(_form.CreateGraphics(), _form.DisplayRectangle);
     }));
 }
开发者ID:jjvdangelo,项目名称:ESTest,代码行数:10,代码来源:DrawingSystem.cs

示例13: Form1_Load

    	private void Form1_Load(object sender, EventArgs e)
        {
        	pbBox.AllowDrop = true;
            BGC = BufferedGraphicsManager.Current;
			view.Window = new Rectangle(0, 0, pbBox.Width - 1, pbBox.Height - 1);
            grOffside = BGC.Allocate(pbBox.CreateGraphics(), view.Window);
            grOffside.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
            grOffside.Graphics.SmoothingMode = SmoothingMode.HighQuality;    		
            timer.Enabled = true;            
        }
开发者ID:Basilid,项目名称:Spheres,代码行数:10,代码来源:Form1.cs

示例14: FlyingDragon

 public FlyingDragon(Graphics g, int width, int height, Pen stroke, Fill fill, int interval)
 {
     _g = g;
     GraphicManager = BufferedGraphicsManager.Current;
     GraphicManager.MaximumBuffer =
         new Size(width + 1, height + 1);
     ManagedBackBuffer =
         GraphicManager.Allocate(_g, new Rectangle(0, 0, width, height));
     _ctx = new CanvasRenderingContext2D(ManagedBackBuffer.Graphics, null, stroke, fill, false);
     this.interval = interval;
 }
开发者ID:podlipensky,项目名称:sharpcanvas,代码行数:11,代码来源:FlyingDragon.cs

示例15: UCNoteGraph

 public UCNoteGraph()
 {
     InitializeComponent();
     PitchStart = 0;
     PitchRange = 20;
     NoteWidth = 5;
     lastNoteLocation = new Point(0, Height);
     bufferedGraphicsContext = BufferedGraphicsManager.Current;
     bufferedGraphics = bufferedGraphicsContext.Allocate(CreateGraphics(), ClientRectangle);
     SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);
 }
开发者ID:puthutp,项目名称:Waver,代码行数:11,代码来源:UCNoteGraph.cs


注:本文中的System.Drawing.BufferedGraphicsContext.Allocate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。