コード例 #1
0
		void CombineClipArea(geom.Area area, CombineMode combineMode) {
			geom.AffineTransform t = GetFinalTransform();
			if (!t.isIdentity())
				area.transform(t);
			if (combineMode == CombineMode.Replace) {
				_clip.NativeObject.reset();
				_clip.NativeObject.add(area);
			}
			else {
				geom.Area curClip = _clip.NativeObject;
				switch(combineMode) {
					case CombineMode.Complement:
						curClip.add(area);
						break;
					case CombineMode.Exclude:
						curClip.subtract(area);
						break;
					case CombineMode.Intersect:
						curClip.intersect(area);
						break;
					case CombineMode.Union:
						curClip.add(area);
						break;
					case CombineMode.Xor:
						curClip.exclusiveOr(area);
						break;
					default:
						throw new ArgumentOutOfRangeException();					
				}
			}

			RestoreBaseClip();
			NativeObject.clip(_clip);
		}
コード例 #2
0
		void IntersectClip (geom.Area area) {
			
			geom.AffineTransform t = GetFinalTransform();
			if (!t.isIdentity()) {
				area = (geom.Area) area.clone ();
				area.transform(t);
			}

			_clip.NativeObject.intersect(area);
			RestoreBaseClip();
			NativeObject.clip(_clip);
		}