public static void GoToCreate(SceneEditingModel model) { if (!CapturePageNotSupported.IsCaptureSupported(model)) { model.GoToPage(new CapturePageNotSupported()); } else { var items = model.SceneState.Device.Displays; if (items != null && items.Length > 0) { var first = model.SceneState.Device.Displays[0]; var source = new SceneItemSource { CaptureDisplay = new SceneItemSourceCapture { CaptureCursor = true, Source = first } }; model.AddSourceToScene(source); } else { model.SelectAddLayer(); } } }
private static void AddPlugin(SceneEditingModel model) { var source = new SceneItemSource { Lovense = new SceneItemSourceLovense() }; model.AddSourceToScene(source, true); }
protected void DoSelect(CaptureSource model) { var source = new SceneItemSource(); _setConfig(source, new SceneItemSourceCapture { Source = model, CaptureCursor = CaptureCursor.Value }); if (_editing != null) { _editing.Source = source; } else { _model.AddSourceToScene(source, false, GetRect(model)); } }
private void UpdateOrCreateItem(string id, byte[] data) { var source = new SceneItemSource { Image = new SceneItemSourceImage { ResourceId = id } }; if (Editing) { _editedItem.Source = source; } else { var size = _model.ImageHelper.GetSize(data); SceneRect rect = null; if (size.width > 0 && size.height > 0) { var ratio = (double)size.width / (double)size.height; var baseExtent = 0.5; var baseRatio = 16.0 / 9.0; if (ratio > baseRatio) { rect = new SceneRect { W = baseExtent, H = baseExtent * baseRatio / ratio } } ; else { rect = new SceneRect { W = baseExtent * ratio / baseRatio, H = baseExtent } }; } _model.AddSourceToScene(source, false, rect); } }
public WebBrowserPageAdd(SceneEditingModel parent) { Go.Execute = () => parent.AddSourceToScene(GetModel()); }