当前位置: 首页 > news >正文

国外最大的素材网站网站头条怎么做

国外最大的素材网站,网站头条怎么做,天津建设工程信息网招标代理资格,网站访问量统计工具1 泛洪填充算法(Flood Fill Algorithm) 泛洪填充算法(Flood Fill Algorithm) ,又称洪水填充算法,是在很多图形绘制软件中常用的填充算法,最熟悉不过就是 windows 自带画图软件的油漆桶功能。 2 源程序 using System; using System.Collecti…

1 泛洪填充算法(Flood Fill Algorithm)

泛洪填充算法(Flood Fill Algorithm) ,又称洪水填充算法,是在很多图形绘制软件中常用的填充算法,最熟悉不过就是 windows 自带画图软件的油漆桶功能。

2 源程序

using System;
using System.Collections;
using System.Collections.Generic;

namespace Legalsoft.Truffer.Algorithm
{
    /// <summary>
    /// 洪水填充算法
    /// </summary>
    public static partial class Algorithm_Gallery
    {
        private static void Fill_4Directions(int[,] screen, int x, int y, int prevC, int newC)
        {
            int M = screen.GetLength(0);
            int N = screen.GetLength(1);

            if (x < 0 || x >= M || y < 0 || y >= N)
            {
                return;
            }
            if (screen[x, y] != prevC)
            {
                return;
            }
            screen[x, y] = newC;
            Fill_4Directions(screen, x + 1, y, prevC, newC);
            Fill_4Directions(screen, x - 1, y, prevC, newC);
            Fill_4Directions(screen, x, y + 1, prevC, newC);
            Fill_4Directions(screen, x, y - 1, prevC, newC);
        }

        public static void Flood_Fill(int[,] screen, int x, int y, int newC)
        {
            int prevC = screen[x, y];
            if (prevC == newC)
            {
                return;
            }
            Fill_4Directions(screen, x, y, prevC, newC);
        }
    }
}

3 代码格式

using System;
using System.Collections;
using System.Collections.Generic;namespace Legalsoft.Truffer.Algorithm
{/// <summary>/// 洪水填充算法/// </summary>public static partial class Algorithm_Gallery{private static void Fill_4Directions(int[,] screen, int x, int y, int prevC, int newC){int M = screen.GetLength(0);int N = screen.GetLength(1);if (x < 0 || x >= M || y < 0 || y >= N){return;}if (screen[x, y] != prevC){return;}screen[x, y] = newC;Fill_4Directions(screen, x + 1, y, prevC, newC);Fill_4Directions(screen, x - 1, y, prevC, newC);Fill_4Directions(screen, x, y + 1, prevC, newC);Fill_4Directions(screen, x, y - 1, prevC, newC);}public static void Flood_Fill(int[,] screen, int x, int y, int newC){int prevC = screen[x, y];if (prevC == newC){return;}Fill_4Directions(screen, x, y, prevC, newC);}}
}

http://www.yayakq.cn/news/507316/

相关文章:

  • 做暧视频免费网站怎么自己创建小程序
  • 百度网站优化 件电商公司名字大全参考
  • 网站后台管理员扫描微信小程序的开发环境
  • 做网站的流程前端做什么重庆中小企业网站建设公司
  • 如何在国外做网站mean网站开发
  • 如何做网站图标seo和sem的关系为负关系
  • 南皮县做网站盐城网站建设小程序公司
  • 网站管理助手4.0 mysql产品网络营销分析
  • 怎样设置网站哪里卖网站域名
  • 注册网站要多久百度收录网站技巧
  • 海南响应式网站建设制作官方正版浏览器
  • 网站的公告轮播效果怎么做如何来做网站
  • 你有网站 我做房东 只收佣金的网站公司网站制作第三方
  • 旅游景点企业网站排名招商加盟网站模板html
  • 买域名送网站设计广告图片
  • 地图网站抓取网址转换成二维码
  • 网站建设方案书0大连开发区做网站的公司
  • 中体建设集团门户登录重庆网站排名优化公司
  • 如何在网上建立自己的网站昆明网络公司排行榜
  • 东营网站建设设计网站关键词排名怎么优化
  • 公司网站建设怎么入账大商创官网
  • 深圳龙华住房和建设局网站官网用腾讯云服务器做网站
  • 网站频道规划关键词排名优化软件
  • 男男床做视频网站在线做网站手机验证收费吗
  • 企业网站建设招标学校网站建设需求分析调研表
  • 大连制作网站软件网站自动生成
  • 网站好坏怎么分析广东新闻发布会
  • 吉林省建设招标网站网站建设规划书样板
  • 网站建设哪家好公司深圳上市公司
  • 网站怎么上传ftpwordpress采集商品