本文整理汇总了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);
}
示例2: BitMapSkipper
public BitMapSkipper(IBitmap bitmap, List<Point2D> points)
{
FromVectors(points);
CreateScans();
FillScans(points);
FormatScans(bitmap);
}
示例3: Fill
public static Bitmap Fill(IBitmap contraints, VectorInt2 p)
{
var result = new Bitmap(contraints.Size);
FillCell(contraints, result, p);
return result;
}
示例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;
}
示例5: Release
public void Release(IBitmap bitmap)
{
if (!MathUtils.IsPowerOf2(bitmap.Width) ||
!MathUtils.IsPowerOf2(bitmap.Height)) return;
getPool(bitmap.Width, bitmap.Height).Release(bitmap);
}
示例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;
}
示例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;
}
}
示例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];
}
}
示例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;
}
示例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;
}
示例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);
}
}
示例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;
}
}
示例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);
}
示例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();
}
示例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);
}