/// <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) { Bitmap img = null; DA.GetData(0, ref img); List <Color> C = new List <Color>(); DA.GetDataList(1, C); DA.SetData(0, ImageConstruct.CreateGradient(img, C)); }
/// <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) { Bitmap img = null; DA.GetData(0, ref img); Color Cs = Color.Black; DA.GetData(1, ref Cs); Color Ce = Color.White; DA.GetData(2, ref Ce); int angle = 0; DA.GetData(3, ref angle); int factor = 0; DA.GetData(4, ref factor); DA.SetData(0, ImageConstruct.CreateGradient(img, Cs, Ce, angle, factor / 100.0f)); //DA.SetData(0, ImageConstruct.CreateGradient2(img, Cs, Ce, new PointF(0, 0), // new PointF(img.Width, (int)(img.Height/2f)), factor / 100.0f)); }