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


C# IArea类代码示例

本文整理汇总了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);
		}
开发者ID:tzachshabtay,项目名称:MonoAGS,代码行数:25,代码来源:DesktopBitmap.cs

示例2: AreaStream

        public AreaStream(IArea area)
        {
            if (area == null)
                throw new ArgumentNullException("area");

            this.area = area;
        }
开发者ID:prepare,项目名称:deveeldb,代码行数:7,代码来源:AreaStream.cs

示例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);
		}
开发者ID:tzachshabtay,项目名称:MonoAGS,代码行数:25,代码来源:AndroidBitmap.cs

示例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();
 }
开发者ID:mwpowellhtx,项目名称:clockworks,代码行数:15,代码来源:SolidAngleBase.cs

示例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";
            }
        }
开发者ID:Aliceljm1,项目名称:kiss-project.web,代码行数:35,代码来源:MobileDetect.cs

示例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);
        }
开发者ID:PublicHealthEngland,项目名称:fingertips-open,代码行数:28,代码来源:CoreDataSetProviderFactory.cs

示例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;
        }
开发者ID:chkr1011,项目名称:CK.HomeAutomation,代码行数:9,代码来源:ActuatorFactory.cs

示例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));
     }
 }
开发者ID:PublicHealthEngland,项目名称:fingertips-open,代码行数:9,代码来源:BenchmarkDataProvider.cs

示例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;
		}
开发者ID:tzachshabtay,项目名称:MonoAGS,代码行数:9,代码来源:AGSScalingArea.cs

示例10: GetNationalArea

 protected IArea GetNationalArea(IArea area)
 {
     if (_nationalArea == null)
     {
         _nationalArea = area.IsCountry
             ? area
             : AreaFactory.NewArea(_areasReader, AreaCodes.England);
     }
     return _nationalArea;
 }
开发者ID:PublicHealthEngland,项目名称:fingertips-open,代码行数:10,代码来源:PartitionDataBuilderBase.cs

示例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;
        }
开发者ID:chkr1011,项目名称:CK.HomeAutomation,代码行数:10,代码来源:ActuatorFactory.cs

示例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;
        }
开发者ID:chkr1011,项目名称:CK.HomeAutomation,代码行数:10,代码来源:SensorFactory.cs

示例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;
		}
开发者ID:tzachshabtay,项目名称:MonoAGS,代码行数:10,代码来源:AGSWalkBehindsMap.cs

示例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;
        }
开发者ID:erpframework,项目名称:cloudb,代码行数:10,代码来源:AreaInputStream.cs

示例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;
        }
开发者ID:chkr1011,项目名称:CK.HomeAutomation,代码行数:10,代码来源:ActuatorFactory.cs


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