コード例 #1
0
        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            string     filePath = null;
            ImageStyle style    = null;

            if (!DA.GetData <string>(0, ref filePath))
            {
                return;
            }
            if (!DA.GetData <ImageStyle>(1, ref style))
            {
                return;
            }

            D3jsLib.Image image = new D3jsLib.Image(filePath, style);

            DA.SetData(0, image);
        }
コード例 #2
0
        /// <summary>
        ///     Image class.
        /// </summary>
        /// <param name="FilePath">Path to the image.</param>
        /// <param name="Style">Style</param>
        /// <returns name="Image">Image object</returns>
        /// <search>image</search>
        public static D3jsLib.Image Create(object FilePath, ImageStyle Style)
        {
            // get full path to file as string
            // if File.FromPath is used it returns FileInfo class
            string _filePath = "";

            try
            {
                _filePath = (string)FilePath;
            }
            catch
            {
                _filePath = ((FileInfo)FilePath).FullName;
            }

            D3jsLib.Image image = new D3jsLib.Image(_filePath, Style);
            return(image);
        }
コード例 #3
0
ファイル: Image.cs プロジェクト: tatlin/Mandrill
 /// <summary>
 ///     Image class.
 /// </summary>
 /// <param name="FilePath">Path to the image.</param>
 /// <param name="Style">Style</param>
 /// <returns name="Image">Image object</returns>
 /// <search>image</search>
 public static D3jsLib.Image Create(string FilePath, ImageStyle Style)
 {
     D3jsLib.Image image = new D3jsLib.Image(FilePath, Style);
     return(image);
 }