本文整理汇总了C#中IArea类的典型用法代码示例。如果您正苦于以下问题:C# IArea类的具体用法?C# IArea怎么用?C# IArea使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IArea类属于命名空间,在下文中一共展示了IArea类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ApplyArea
public IBitmap ApplyArea(IArea area)
{
//todo: performance can be improved by only creating a bitmap the size of the area, and not the entire background.
//This will require to change the rendering as well to offset the location
byte zero = (byte)0;
Bitmap output = new Bitmap(Width, Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
using (FastBitmap inBmp = new FastBitmap (_bitmap, ImageLockMode.ReadOnly))
{
using (FastBitmap outBmp = new FastBitmap (output, ImageLockMode.WriteOnly, true))
{
for (int y = 0; y < Height; y++)
{
int bitmapY = Height - y - 1;
for (int x = 0; x < Width; x++)
{
System.Drawing.Color color = inBmp.GetPixel(x, bitmapY);
byte alpha = area.IsInArea(new AGS.API.PointF(x, y)) ? color.A : zero;
outBmp.SetPixel(x, bitmapY, System.Drawing.Color.FromArgb(alpha, color));
}
}
}
}
return new DesktopBitmap(output, _graphics);
}
示例2: AreaStream
public AreaStream(IArea area)
{
if (area == null)
throw new ArgumentNullException("area");
this.area = area;
}
示例3: ApplyArea
public IBitmap ApplyArea(IArea area)
{
//todo: performance can be improved by only creating a bitmap the size of the area, and not the entire background.
//This will require to change the rendering as well to offset the location
byte zero = (byte)0;
Bitmap output = Bitmap.CreateBitmap(Width, Height, Bitmap.Config.Argb8888);
using (FastBitmap inBmp = new FastBitmap (_bitmap))
{
using (FastBitmap outBmp = new FastBitmap (output, true))
{
for (int y = 0; y < Height; y++)
{
int bitmapY = Height - y - 1;
for (int x = 0; x < Width; x++)
{
global::Android.Graphics.Color color = inBmp.GetPixel(x, bitmapY);
byte alpha = area.IsInArea(new AGS.API.PointF(x, y)) ? color.A : zero;
outBmp.SetPixel(x, bitmapY, new global::Android.Graphics.Color(color.R, color.G, color.B, alpha));
}
}
}
}
return new AndroidBitmap(output, _graphics);
}
示例4: SolidAngleBase
/// <summary>
///
/// </summary>
/// <param name="abbreviation"></param>
/// <param name="toBase"></param>
/// <param name="fromBase"></param>
/// <param name="surfaceArea"></param>
/// <param name="squareRadius"></param>
protected SolidAngleBase(string abbreviation,
IUnitConversion toBase, IUnitConversion fromBase,
IArea surfaceArea, ILength squareRadius)
: base(abbreviation, toBase, fromBase, surfaceArea, squareRadius)
{
VerifyDimensions();
}
示例5: GetRealThemeName
public string GetRealThemeName(IArea area, string theme)
{
if (string.IsNullOrEmpty(theme))
theme = "default";
string dir = Path.Combine(ServerUtil.MapPath(area.VirtualPath), "themes");
string format = theme;
if (format.IndexOf('.') != -1)
format = format.Split('.')[0];
if (IsMobile)
{
if (Directory.Exists(Path.Combine(dir, string.Format("{0}_mobile", theme))))
return string.Format("{0}_mobile", theme);
if (format != theme && Directory.Exists(Path.Combine(dir, string.Format("{0}_mobile", format))))
return string.Format("{0}_mobile", format);
if (format != "default" && Directory.Exists(Path.Combine(dir, "default_mobile")))
return "default_mobile";
return "default";
}
else
{
if (Directory.Exists(Path.Combine(dir, theme)))
return theme;
if (format != theme && Directory.Exists(Path.Combine(dir, format)))
return format;
return "default";
}
}
示例6: New
public CoreDataSetProvider New(IArea area)
{
Area _area = area as Area;
if (_area == null)
{
CategoryArea categoryArea = area as CategoryArea;
if (categoryArea.IsGpDeprivationDecile)
{
return new GpDeprivationDecileCoreDataSetProvider(categoryArea, PracticeDataAccess);
}
return new CategoryAreaCoreDataSetProvider(categoryArea, GroupDataReader);
}
// Area
if (_area.IsCcg)
{
return new CcgCoreDataSetProvider(_area,
CcgPopulationProvider, CoreDataSetListProvider, GroupDataReader);
}
if (_area.IsShape)
{
return new ShapeCoreDataSetProvider(_area, PracticeDataAccess);
}
return new SimpleCoreDataSetProvider(_area, GroupDataReader);
}
示例7: RegisterLogicalActuator
public LogicalBinaryStateActuator RegisterLogicalActuator(IArea area, Enum id)
{
if (area == null) throw new ArgumentNullException(nameof(area));
var actuator = new LogicalBinaryStateActuator(ComponentIdGenerator.Generate(area.Id, id), _timerService);
area.AddComponent(actuator);
return actuator;
}
示例8: CheckOnlyOneCoreDataSetFound
private static void CheckOnlyOneCoreDataSetFound(Grouping grouping, IArea area,
IList<CoreDataSet> dataList)
{
if (dataList.Count > 1)
{
throw new FingertipsException(string.Format("More than one CoreDataSet row for: IndicatorId={0} Area={1}",
grouping.IndicatorId, area.Code));
}
}
示例9: Create
public static void Create(IArea area, float minScaling, float maxScaling, bool scaleObjectsX = true, bool scaleObjectsY = true, bool scaleVolume = true)
{
var component = area.AddComponent<IScalingArea>();
component.MinScaling = minScaling;
component.MaxScaling = maxScaling;
component.ScaleObjectsX = scaleObjectsX;
component.ScaleObjectsY = scaleObjectsY;
component.ScaleVolume = scaleVolume;
}
示例10: GetNationalArea
protected IArea GetNationalArea(IArea area)
{
if (_nationalArea == null)
{
_nationalArea = area.IsCountry
? area
: AreaFactory.NewArea(_areasReader, AreaCodes.England);
}
return _nationalArea;
}
示例11: RegisterLamp
public ILamp RegisterLamp(IArea area, Enum id, IBinaryOutput output)
{
if (area == null) throw new ArgumentNullException(nameof(area));
if (output == null) throw new ArgumentNullException(nameof(output));
var lamp = new Lamp(ComponentIdGenerator.Generate(area.Id, id), new PortBasedBinaryStateEndpoint(output));
area.AddComponent(lamp);
return lamp;
}
示例12: RegisterHumiditySensor
public IHumiditySensor RegisterHumiditySensor(IArea area, Enum id, INumericValueSensorEndpoint endpoint)
{
if (area == null) throw new ArgumentNullException(nameof(area));
if (endpoint == null) throw new ArgumentNullException(nameof(endpoint));
var humditySensor = new HumiditySensor(ComponentIdGenerator.Generate(area.Id, id), _settingsService, endpoint);
area.AddComponent(humditySensor);
return humditySensor;
}
示例13: 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;
}
示例14: AreaInputStream
public AreaInputStream(IArea area, int buffer_size)
{
if (buffer_size <= 0)
throw new ArgumentOutOfRangeException("buffer_size", "The buffer size cannot be smaller or equal to 0.");
this.area = area;
this.buffer = new byte[buffer_size];
this.count = 0;
this.pos = 0;
}
示例15: RegisterSocket
public ISocket RegisterSocket(IArea area, Enum id, IBinaryOutput output)
{
if (area == null) throw new ArgumentNullException(nameof(area));
if (output == null) throw new ArgumentNullException(nameof(output));
var socket = new Socket(ComponentIdGenerator.Generate(area.Id, id), new PortBasedBinaryStateEndpoint(output));
area.AddComponent(socket);
return socket;
}