public void Draw(int c, int k, double zoom, bool color) { var fm = new FractalModel(); fm.c = c; fm.num = k; fm.xmax = 2 / zoom; fm.xmin = -2 / zoom; fm.ymax = 2 / zoom; fm.ymin = -2 / zoom; fm.color = color; var b = fm.image; BitmapSource src = (BitmapSource)b.ImageSource; string path = @"D:\projekt\Computer-Graphics\CGv2\CGv2\Resourses\images\Fractal.jpg"; using (FileStream fs1 = new FileStream(path, FileMode.OpenOrCreate)) { BitmapFrame frame = BitmapFrame.Create(src); JpegBitmapEncoder enc = new JpegBitmapEncoder(); enc.Frames.Add(frame); enc.Save(fs1); } }
private ImplicitFractal GetFractal(FractalModel model) { return(new ImplicitFractal((FractalType)model.FractalType.Value, (BasisType)model.BasisType.Value, (InterpolationType)model.InterpolationType.Value, model.Octaves.Value, model.Frequency.Value, model.Seed.Value)); }