Ejemplo n.º 1
0
        public virtual string GetExpr(ImageItem item)
        {
            var opts = "comp:" + item.FinalDimensions.Width + ',' + item.FinalDimensions.Height;

            /////////////////////////////////////////////////////////
            // Background

            var origBgSize = GetOriginalBGSize(item.SizeType);

            var aspectRatio = origBgSize.Width / (float)origBgSize.Height;
            var newBgHeight = (int)(item.FinalDimensions.Width / aspectRatio);

            var bgPath = GetBGPath(item.SizeType);

            if (bgPath != null)
            {
                var dimensions = new Size(item.FinalDimensions.Width, newBgHeight);
                opts += ";" + CompositedLayer.MakeString(bgPath, 0, 0, null, dimensions);
            }

            /////////////////////////////////////////////////////////
            // Foreground

            opts += ";" + CompositedLayer.MakeString(
                item.ForegroundImagePath,
                item.ForegroundCoords.X,
                item.ForegroundCoords.Y,
                null,
                Size.Empty
                );

            return(opts);
        }
Ejemplo n.º 2
0
		public virtual String GetExpr(ImageItem item) {
			
			String opts = "comp:" + item.FinalDimensions.Width + ',' + item.FinalDimensions.Height;
			
			/////////////////////////////////////////////////////////
			// Background
			
			Size origBgSize = GetOriginalBGSize( item.SizeType );
			
			Single aspectRatio = (Single)origBgSize.Width / (Single)origBgSize.Height;
			Int32  newBgHeight  = (Int32)( (Single)item.FinalDimensions.Width / aspectRatio );
			
			String bgPath = GetBGPath( item.SizeType );
			if( bgPath != null ) {
				Size dimensions = new Size( item.FinalDimensions.Width, newBgHeight );
				opts += ";" + CompositedLayer.MakeString( bgPath, 0, 0, null, dimensions );
			}
			
			/////////////////////////////////////////////////////////
			// Foreground
			
			opts += ";" + CompositedLayer.MakeString( item.ForegroundImagePath, item.ForegroundCoords.X, item.ForegroundCoords.Y, null, Size.Empty );
			
			return opts;
		}
Ejemplo n.º 3
0
		public override String GetExpr(ImageItem item) {
			
			String opts = base.GetExpr(item);
			
			//////////////////////////////////
			// Background Stripe (goes at the very front because sometimes the foreground spreads on to it)
			if( item.SizeType != SizeType.Small ) {
				
				opts += ";" + CompositedLayer.MakeString( pathToStripe, item.FinalDimensions.Width - 3, 0, null, Size.Empty );
			}
			
			return opts;
		}