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


C# IBitmap类代码示例

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


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

示例1: DrawImage

 public void DrawImage(IBitmap source, double opacity, Rect sourceRect, Rect destRect)
 {
     var impl = (BitmapImpl) source.PlatformImpl;
     var s = SkRect.FromRect(sourceRect);
     var d = SkRect.FromRect(destRect);
     MethodTable.Instance.DrawImage(Handle, impl.Handle, (float) opacity, ref s, ref d);
 }
开发者ID:abdelkarim,项目名称:Perspex,代码行数:7,代码来源:DrawingContextImpl.cs

示例2: BitMapSkipper

 public BitMapSkipper(IBitmap bitmap, List<Point2D> points)
 {
     FromVectors(points);
     CreateScans();
     FillScans(points);
     FormatScans(bitmap);
 }
开发者ID:bsvercl,项目名称:physics2d,代码行数:7,代码来源:BitmapHelper.cs

示例3: Fill

        public static Bitmap Fill(IBitmap contraints, VectorInt2 p)
        {
            var result = new Bitmap(contraints.Size);
            FillCell(contraints, result, p);

            return result;
        }
开发者ID:guylangston,项目名称:SokoSolve,代码行数:7,代码来源:FloodFill.cs

示例4: VideoTrack

        /// <summary>
        /// 
        /// </summary>
        /// <param name="bitmap"></param>
        public VideoTrack(IBitmap bitmap)
        {
            Contract.Requires(bitmap != null);

            this.dimensions = new Size(bitmap.Width, bitmap.Height);
            this.format = bitmap.Format;
        }
开发者ID:eriser,项目名称:nsynth,代码行数:11,代码来源:VideoTrack.cs

示例5: Release

		public void Release(IBitmap bitmap)
		{
			if (!MathUtils.IsPowerOf2(bitmap.Width) ||
			    !MathUtils.IsPowerOf2(bitmap.Height)) return;

			getPool(bitmap.Width, bitmap.Height).Release(bitmap);
		}
开发者ID:tzachshabtay,项目名称:MonoAGS,代码行数:7,代码来源:BitmapPool.cs

示例6: ActionSheetOptionViewModel

 public ActionSheetOptionViewModel(bool visible, string text, Action action, IBitmap image = null)
 {
     this.Text = text;
     this.Action = new Command(action);
     this.Visible = visible ? Visibility.Visible : Visibility.Collapsed;
     this.ItemIcon = image;
 }
开发者ID:philippd,项目名称:userdialogs,代码行数:7,代码来源:ActionSheetOptionViewModel.cs

示例7: Matrix

 /// <summary>
 /// Init from a bitmap, setting on true positions to <paramref name="Value"/>
 /// </summary>
 /// <param name="Bitmap"></param>
 /// <param name="Value"></param>
 public Matrix(IBitmap Bitmap, float Value)
 {
     Size = Bitmap.Size;
     for (int ccx = 0; ccx < Width; ccx++)
         for (int ccy = 0; ccy < Height; ccy++)
         {
             if (Bitmap[ccx, ccy]) this[ccx, ccy] = Value;
         }
 }
开发者ID:rfrfrf,项目名称:SokoSolve-Sokoban,代码行数:14,代码来源:Matrix.cs

示例8: Bitmap

 /// <summary>
 /// Copy Constructor. Deep copy.
 /// </summary>
 /// <param name="copy"></param>
 public Bitmap(IBitmap copy)
     : this(copy.Size.X, copy.Size.Y)
 {
     for (int cy = 0; cy < copy.Size.Y; cy++)
         for (int cx = 0; cx < copy.Size.X; cx++)
         {
             this[cx, cy] = copy[cx, cy];
         }
 }
开发者ID:rfrfrf,项目名称:SokoSolve-Sokoban,代码行数:13,代码来源:Bitmap.cs

示例9: GetDrawable

        public IObject GetDrawable(IArea area, IBitmap bg)
		{
            IWalkBehindArea walkBehind = area.GetComponent<IWalkBehindArea>();
            if (walkBehind == null) return null;
			AreaKey key = new AreaKey (area, bg);
			IObject obj = _objects.GetOrAdd(key, () => createObject());
			obj.Z = walkBehind.Baseline == null ? area.Mask.MinY : walkBehind.Baseline.Value;
			obj.Image = _images.GetOrAdd(key, () => createImage(area, bg));
			return obj;
		}
开发者ID:tzachshabtay,项目名称:MonoAGS,代码行数:10,代码来源:AGSWalkBehindsMap.cs

示例10: GLImage

        public GLImage(IBitmap bitmap, string id, ITexture texture, ISpriteSheet spriteSheet, ILoadImageConfig loadConfig)
		{
			OriginalBitmap = bitmap;
			Width = bitmap.Width;
			Height = bitmap.Height;
			ID = id;
			Texture = texture;
			SpriteSheet = spriteSheet;
			LoadConfig = loadConfig;
		}
开发者ID:tzachshabtay,项目名称:MonoAGS,代码行数:10,代码来源:GLImage.cs

示例11: DrawImage

 public void DrawImage(IBitmap source, double opacity, Rect sourceRect, Rect destRect)
 {
     var impl = (BitmapImpl)source.PlatformImpl;
     var s = sourceRect.ToSKRect();
     var d = destRect.ToSKRect();
     using (var paint = new SKPaint()
             { Color = new SKColor(255, 255, 255, (byte)(255 * opacity)) })
     {
         Canvas.DrawBitmap(impl.Bitmap, s, d, paint);
     }
 }
开发者ID:CarlSosaDev,项目名称:Avalonia,代码行数:11,代码来源:DrawingContextImpl.cs

示例12: InvertBitmap

 private void InvertBitmap(IBitmap bitmap)
 {
     for (int y = 0; y < bitmap.Height; y++)
         for (int x = 0; x < bitmap.Width; x++)
         {
             var px = bitmap[x, y];
             px.Red = 1.0f - px.Red;
             px.Green = 1.0f - px.Green;
             px.Blue = 1.0f - px.Blue;
             bitmap[x, y] = px;
         }
 }
开发者ID:eriser,项目名称:nsynth,代码行数:12,代码来源:InvertFilter.cs

示例13: SkyBox

        public SkyBox(IBitmap neg_x, IBitmap pos_x, IBitmap neg_y, IBitmap pos_y, IBitmap neg_z, IBitmap pos_z)
        {
            _config = Constants.Kernel.Get<RenderConfig>();
			
            ITextureAtlasFactory atlasFactory = Constants.Kernel.Get<ITextureAtlasFactory>();
            _atlas = atlasFactory.CreateTextureAtlas(new Size(_config.MaxTextureSize,_config.MaxTextureSize/2), new Size(_config.MaxTextureSize / 4, _config.MaxTextureSize / 4), 1);
            _neg_x = _atlas.AddSubImage(neg_x);
            _pos_x = _atlas.AddSubImage(pos_x);
            _pos_y = _atlas.AddSubImage(pos_y);
            _neg_y = _atlas.AddSubImage(neg_y);
            _pos_z = _atlas.AddSubImage(pos_z);
            _neg_z = _atlas.AddSubImage(neg_z);
        }
开发者ID:AugustoAngeletti,项目名称:blockspaces,代码行数:13,代码来源:SkyBox.cs

示例14: DrawImage

        public void DrawImage(IBitmap bitmap, double opacity, Rect sourceRect, Rect destRect)
        {
            var impl = bitmap.PlatformImpl as BitmapImpl;
            var size = new Size(impl.PixelWidth, impl.PixelHeight);
            var scaleX = destRect.Size.Width / sourceRect.Size.Width;
            var scaleY = destRect.Size.Height / sourceRect.Size.Height;

            _context.Save();
            _context.Scale(scaleX, scaleY);
            Gdk.CairoHelper.SetSourcePixbuf(_context, impl.Surface, (int)sourceRect.X, (int)sourceRect.Y);
            _context.Rectangle(sourceRect.ToCairo());
            _context.Fill();
            _context.Restore();
        }
开发者ID:healtech,项目名称:Perspex,代码行数:14,代码来源:DrawingContext.cs

示例15: FillCell

        private static void FillCell(IBitmap contraints, IBitmap result, VectorInt2 p)
        {
            if (p.X < 0 || p.Y < 0) return;
            if (p.X > contraints.Size.X || p.Y > contraints.Size.Y) return;

            if (contraints[p]) return;
            if (result[p]) return;

            result[p] = true;

            FillCell(contraints, result, p + VectorInt2.Up);
            FillCell(contraints, result, p + VectorInt2.Down);
            FillCell(contraints, result, p + VectorInt2.Left);
            FillCell(contraints, result, p + VectorInt2.Right);
        }
开发者ID:guylangston,项目名称:SokoSolve,代码行数:15,代码来源:FloodFill.cs


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