• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Drawing.BufferedGraphicsContext类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



BufferedGraphicsContext类属于System.Drawing命名空间,在下文中一共展示了BufferedGraphicsContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: 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


示例2: Form1_Load

        private void Form1_Load(object sender, EventArgs e)
        {
            // Gets a reference to the current BufferedGraphicsContext
            currentContext = BufferedGraphicsManager.Current;

            // New random generator
            rGen = new Random();

            // Make Ships
            ships = new List<Ship>();
            for (int i = 0; i < SHIPS; i++)
                ships.Add(new Ship(rGen, canvas.Width, canvas.Height));

            // Make Bots
            bots = new List<Bot>();
            for (int i = 0; i < BOTS; i++)
                bots.Add(new Bot(rGen, canvas.Width, canvas.Height, i * 30));

            // Create the eventmanager
            eManager = new EventManager(rGen, bots, ships);

            // Load into objects list for move, update, draw
            objects = new List<SimulationObject>();
            objects.AddRange(ships);
            objects.AddRange(bots);

            // Start the timer
            clock.Enabled = true;
        }
开发者ID:rNdm74,项目名称:C-,代码行数:29,代码来源:Form1.cs


示例3: Form1

        public Form1()
        {
            InitializeComponent();
            this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true);

            this.Width = 640;
            this.Height = 480;
            pnlRenderArea.Top = 0;
            pnlRenderArea.Left = 0;
            pnlRenderArea.Width = ClientRectangle.Width;
            pnlRenderArea.Height = ClientRectangle.Height;

            // Retrieves the BufferedGraphicsContext for the
            // current application domain.
            context = BufferedGraphicsManager.Current;

            // Sets the maximum size for the primary graphics buffer
            // of the buffered graphics context for the application
            // domain.  Any allocation requests for a buffer larger
            // than this will create a temporary buffered graphics
            // context to host the graphics buffer.
            context.MaximumBuffer = new Size(this.Width + 1, this.Height + 1);

            // Allocates a graphics buffer the size of this form
            // using the pixel format of the Graphics created by
            // the Form.CreateGraphics() method, which returns a
            // Graphics object that matches the pixel format of the form.
            grafx = GetGraphics(pnlRenderArea);
        }
开发者ID:jmoral4,项目名称:Tears,代码行数:29,代码来源:Form1.cs


示例4: DrawerWnd

        public DrawerWnd(CDrawer dr)
        {
            InitializeComponent();

            // use the log as built from parent
            _log = dr._log;

            // save window size
            m_ciWidth = dr.m_ciWidth;
            m_ciHeight = dr.m_ciHeight;

            // cap delegates, this will be set by owner
            m_delRender = null;
            m_delMouseMove = null;
            m_delMouseLeftClick = null;
            m_delMouseRightClick = null;

            // cap/set references
            m_bgc = new BufferedGraphicsContext();
            m_bg = null;

            // create the bitmap for the underlay and clear it to whatever colour
            m_bmUnderlay = new Bitmap(dr.m_ciWidth, dr.m_ciHeight);    // docs say will use Format32bppArgb

            // fill the bitmap with the default drawer bb colour
            FillBB(Color.Black);

            // show that drawer is up and running
            _log.WriteLine("Drawer Started...");
        }
开发者ID:NigelColpitts,项目名称:GDIDrawer,代码行数:30,代码来源:DrawerWnd.cs


示例5: BufferedControl

 public BufferedControl()
 {
     _BufferContext = new BufferedGraphicsContext();
       SizeGraphicsBuffer();
       SetStyle(ControlStyles.OptimizedDoubleBuffer, false);
       SetStyle(ControlStyles.DoubleBuffer, false);
 }
开发者ID:jrusev,项目名称:Games,代码行数:7,代码来源:BufferedControl.cs


示例6: 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


示例7: MainForm

 public MainForm()
 {
     InitializeComponent();
     doc = new Document();
     bufferContext = new BufferedGraphicsContext();
     bufferContext.MaximumBuffer = this.ClientRectangle.Size;
 }
开发者ID:nmackay132,项目名称:COP4226_HW3,代码行数:7,代码来源:MainForm.cs


示例8: UltraPanel

 public UltraPanel()
 {
     X = new BufferedGraphicsContext();
     this.Paint += new PaintEventHandler(UltraPanel_Paint);
     firstColor = ColorTranslator.FromHtml("#0077FF");
     lastColor = ColorTranslator.FromHtml("#00FFFF");
 }
开发者ID:krikelin,项目名称:MediaChrome,代码行数:7,代码来源:clsColorPage.cs


示例9: 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


示例10: TopologyRenderControl

        /// <summary>
        /// Initializes a new instance of the <see cref="RenderControl" /> class.
        /// </summary>
        public TopologyRenderControl()
        {
            SetStyle(ControlStyles.ResizeRedraw, true);

            this.BackColor = Color.Black;

            context = new BufferedGraphicsContext();
        }
开发者ID:cmberryau,项目名称:Triangle.NET-3.5,代码行数:11,代码来源:TopologyRenderControl.cs


示例11: Canvas

 public Canvas(Control control)
 {
     this.control = control;
     control.BackColor = Color.SkyBlue;
     context = new BufferedGraphicsContext();
     control.Paint += new PaintEventHandler(control_Paint);
     InitializeGraphics();
 }
开发者ID:fiftin,项目名称:Pengball,代码行数:8,代码来源:Canvas.cs


示例12: BufferedGraphics

        private static int              rop = 0xcc0020; // RasterOp.SOURCE.GetRop();

        /// <include file='doc\BufferedGraphics.uex' path='docs/doc[@for="BufferedGraphics.BufferedGraphics"]/*' />
        /// <devdoc>
        ///         Internal constructor, this class is created by the BufferedGraphicsContext.
        /// </devdoc>
        internal BufferedGraphics(Graphics bufferedGraphicsSurface, BufferedGraphicsContext context, Graphics targetGraphics,
                                  IntPtr targetDC, Point targetLoc, Size virtualSize) {
            this.context = context;
            this.bufferedGraphicsSurface = bufferedGraphicsSurface;
            this.targetDC = targetDC;
            this.targetGraphics = targetGraphics;
            this.targetLoc = targetLoc;
            this.virtualSize = virtualSize;
        }
开发者ID:JianwenSun,项目名称:cc,代码行数:15,代码来源:BufferedGraphics.cs


示例13: Form1

 public Form1()
 {
     InitializeComponent();
     X = new BufferedGraphicsContext();
     G = new Bitmap("test.png");
     collections = new List<Collection>();
     Podcasts = new List<Podcast>();
     fCC = new frmColorChooser(this);
 }
开发者ID:krikelin,项目名称:MediaChrome,代码行数:9,代码来源:Form1.cs


示例14: mainForm

 public mainForm()
 {
     InitializeComponent();
     arrowPen.EndCap = System.Drawing.Drawing2D.LineCap.ArrowAnchor;
     axisPoints[1] = new Point(80, 450);
     axisPoints[0] = new Point(80, 150);
     axisPoints[2] = new Point(380, 450);
     CS = CurrentSimulation.SteeringBehaviours;
     context = new BufferedGraphicsContext();
 }
开发者ID:wfsiew,项目名称:AI-Life,代码行数:10,代码来源:MainForm.cs


示例15: VideoRender

        public VideoRender(PictureBox view)
        {
            this.view = view;
			this.bufferContext = BufferedGraphicsManager.Current;
            this.foreground = new SolidBrush(Color.ForestGreen);
            this.background = new SolidBrush(Color.Black);
        }
开发者ID:fakeezz,项目名称:chip8.net,代码行数:7,代码来源:VideoRender.cs


示例16: 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


示例17: 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


示例18: 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


示例19: 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


示例20: 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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Drawing.CharacterRange类代码示例发布时间:2022-05-26
下一篇:
C# Drawing.BufferedGraphics类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap