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


C# Rectangle.checkBrightnes方法代码示例

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


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

示例1: divideImage

        public override void divideImage(int bright, Rectangle _parent)
        {
            if (lineVert)
            {
                currWidth = currWidth / 2;
                var R = new Rectangle(form, x, y, currWidth, currHight, false, _parent, this.level + 1);
                //if (this.level + 1 > lowestLevel)
                //{
                //    lowestLevel = this.level + 1;
                //}
                if (R.checkBrightnes(x, y, currWidth, currHight, bright))
                {
                    drawLine(currWidth, y, currWidth, currHight, true);
                    form.getSecondPB().Image = Form1.bmpLines;
                    //form.pictureBox2.Refresh();
                    R.divideImage(bright, R);
                }
                //else
                //{
                //    R.checkBrightnes(x, y, currWidth, currHight);
                //}
                var R1 = new Rectangle(form, x + currWidth, y, currWidth, currHight, false, _parent, this.level + 1);
                if (R1.checkBrightnes((x + currWidth), y, currWidth, currHight, bright))
                {
                    drawLine(currWidth, y, currWidth, currHight, true);
                    // Form1.markRed(x + currWidth, y);
                    //form.pictureBox2.Refresh();
                    R1.divideImage(bright, R1);
                }
                //else
                //{
                //    R1.checkBrightnes((x + currWidth), y, currWidth, currHight);
                //}
            }
            else
            {
                currHight = currHight / 2;
                var R = new Rectangle(form, x, y, currWidth, currHight, true, _parent, this.level + 1);
                //if (this.level + 1 > lowestLevel)
                //{
                //    lowestLevel = this.level + 1;
                //}
                if (R.checkBrightnes(x, y, currWidth, currHight, bright))
                {
                    drawLine(x, currHight, currWidth, currHight, false);
                    form.getSecondPB().Image = Form1.bmpLines;
                    //form.pictureBox2.Refresh();
                    R.divideImage(bright, _parent);
                }
                else
                {
                    R.checkBrightnes(x, y, currWidth, currHight);
                }

                var R1 = new Rectangle(form, x, y + currHight, currWidth, currHight, true, parent, this.level + 1);
                if (R1.checkBrightnes(x, (y + currHight), currWidth, currHight, bright))
                {
                    drawLine(x, currHight + y, currWidth, currHight, false);
                    Form1.markRed(x, y + currHight);
                    //form.pictureBox2.Refresh();
                    R1.divideImage(bright, _parent);
                }
                else
                {
                    R1.checkBrightnes(x, (y + currHight), currWidth, currHight);
                }

            }
        }
开发者ID:arapovavikka,项目名称:Triangulation,代码行数:69,代码来源:Form1.cs

示例2: DivImage_Click

        //public List<Triangle> deleteTriangles(List<Triangle> triangles)
        //{
        //    for (int i = 0; i < triangles.Count; i++)
        //    {
        //        for (int j = 0; j < triangles.Count; j++)
        //        {
        //            if(((triangles[i].v1.x == triangles[j].v1.x)||(triangles[i].v1.x == triangles[j].v2.x)||(triangles[i].v1.x == triangles[j].v3.x)) &&
        //                ((triangles[i].v2.x == triangles[j].v1.x)||(triangles[i].v2.x == triangles[j].v2.x)||(triangles[i].v2.x == triangles[j].v3.x)))
        //        }
        //    }
        //    return triangles;
        //}
        private void DivImage_Click(object sender, EventArgs e)
        {
            Rectangle rootRect = new Rectangle(this, 0, 0, 256, 256, true, null, 0);
            initBitmap();
            int brightness = (int)numericUpDown1.Value;
            if (rootRect.checkBrightnes(0, 0, 256, 256, brightness))
            {
                rootRect.divideImage(brightness, rootRect);
            }
            vertexes.Add(new vertex(0, 0, ((Bitmap)Mem).GetPixel(0, 0)));
            vertexes.Add(new vertex(pictureBox2.Size.Width - 1, 0, ((Bitmap)Mem).GetPixel(pictureBox2.Size.Width - 1, 0)));
            vertexes.Add(new vertex(0, pictureBox2.Size.Height - 1, ((Bitmap)Mem).GetPixel(0, pictureBox2.Size.Height - 1)));
            vertexes.Add(new vertex(pictureBox2.Size.Width - 1, pictureBox2.Size.Height - 1, ((Bitmap)Mem).GetPixel(pictureBox2.Size.Width - 1, pictureBox2.Size.Height - 1)));
            //vertexes.Add(new vertex(100, 100, Color.Black));
            //vertexes.Add(new vertex(160, 40, Color.Blue));
            //vertexes.Add(new vertex(40, 20, Color.Red));
            //vertexes.Add(new vertex(80, 80, Color.Red));
            //vertexes.Add(new vertex(60, 130, Color.Black));
            //vertexes.Add(new vertex(180, 100, Color.Black));

            //vertexes.Add(new vertex(100, 100, Color.Black));
            //vertexes.Add(new vertex(100, 200, Color.Black));
            //vertexes.Add(new vertex(200, 100, Color.Black));
            //vertexes.Add(new vertex(200, 200, Color.Black));
            //vertexes.Add(new vertex(150, 150, Color.Black));
            //vertexes.Add(new vertex(150, 175, Color.Black));
            //vertexes.Add(new vertex(175, 150, Color.Black));
            //vertexes.Add(new vertex(175, 175, Color.Black));

            foreach (vertex v in vertexes)
            {
                bmpLines.SetPixel(v.x, v.y, v.currColor);
            }

            pictureBox2.Image = bmpLines;
            pictureBox2.Refresh();
            vertexes = deleteVertexes(vertexes);
            showTops();
        }
开发者ID:arapovavikka,项目名称:Triangulation,代码行数:51,代码来源:Form1.cs


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