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


C# Drawable.Update方法代码示例

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


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

示例1: Render

        public void Render(Image image, Drawable drawable, Progress progress)
        {
            var dimensions = image.Dimensions;

              Tile.CacheDefault(drawable);
              var pf = new PixelFetcher(drawable, false);

              var iter = new RgnIterator(drawable, RunMode.Interactive);
              iter.IterateSrcDest(src => src);

              int dropSize = GetValue<int>("drop_size");
              int fishEye = GetValue<int>("fish_eye");
              int number = GetValue<int>("number");

              var factory = new RaindropFactory(dropSize, fishEye, dimensions);

              for (int numBlurs = 0; numBlurs <= number; numBlurs++)
            {
              var raindrop = factory.Create();
              if (raindrop == null)
            {
              if (progress != null)
            progress.Update(1.0);
              break;
            }

              raindrop.Render(factory.BoolMatrix, pf, drawable);

              if (progress != null)
            progress.Update((double) numBlurs / number);
            }

              pf.Dispose();

              drawable.Flush();
              drawable.Update();
        }
开发者ID:unhammer,项目名称:gimp-sharp,代码行数:37,代码来源:Renderer.cs

示例2: DoDifference

        void DoDifference(Drawable sourceDrawable, Drawable toDiffDrawable)
        {
            _indexedColorsMap = new IndexedColorsMap();

              var rectangle = sourceDrawable.MaskBounds;
              var srcPR = new PixelRgn(sourceDrawable, rectangle, true, true);
              var destPR = new PixelRgn(toDiffDrawable, rectangle, false, false);

              var iterator = new RegionIterator(srcPR, destPR);
              iterator.ForEach((src, dest) => src.Set(MakeAbsDiff(dest, src)));

              sourceDrawable.Flush();
              sourceDrawable.MergeShadow(false);
              sourceDrawable.Update(rectangle);
        }
开发者ID:unhammer,项目名称:gimp-sharp,代码行数:15,代码来源:Renderer.cs

示例3: Render


//.........这里部分代码省略.........
            }

              // big dirty if statement
              if (_pureWhite && markPixel.IsSameColor(whitePixel))
            {
              mask[i, j] = true;
            }
              else if ((_includeOriginal && !imgPixel.IsSameColor(markPixel))
               || (!_includeOriginal && markPixel.Alpha >= threshGuc))
            {
              mask[i, j] = true;
              rgb2yiq(markPixel, out mY, out iI, out iQ);
            }
              else if (sel != null && selRow[selIdx].Red < threshGuc)
            {
              mask[i, j] = true;
            }
              else {
              mask[i, j] = false;
              iI = iQ = 0;
              }

              Y[i, j] = iY;
              I[i, j] = iI;
              Q[i, j] = iQ;
            }
            }

              if (sel != null)
            {
              sel.Detach();
            }

              progress.Update(0.1);

              int n = 0;
              for (i = 0; i < h; i++)
            {
              for (j = 0; j < w; j++)
            {
              if (!mask[i, j])
            {
              int min_ii = Math.Max(0, i - WindowRadius);
              int max_ii = Math.Min(h - 1, i + WindowRadius);
              int min_jj = Math.Max(0, j - WindowRadius);
              int max_jj = Math.Min(w - 1, j + WindowRadius);
              var vary = new int[WindowPixels];
              var varx = new int[WindowPixels];
              var var = new double[WindowPixels];

              int count = 0;
              double sum_sq = 0;
              double sum = 0;
              double min_variance = 1.0;

              for (ii = min_ii; ii <= max_ii; ii++)
            {
              for (jj = min_jj; jj <= max_jj; jj++)
            {
              double val = Y[ii, jj];
              sum += val;
              sum_sq += val * val;

              if (ii == i && jj == j)
                continue;
开发者ID:unhammer,项目名称:gimp-sharp,代码行数:66,代码来源:Colorize.cs


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