public void InitiateDownload(StoreProduct storeProduct) { List <int> stickerIds = storeProduct.stickers.sticker_ids; string baseUrl = storeProduct.stickers.base_url; List <RemoteLocalMapping> downloadList = new List <RemoteLocalMapping>(); foreach (int stickerId in stickerIds) { downloadList.Add(new RemoteLocalMapping() { RemoteUri = baseUrl + (object)stickerId + "/256b.png", LocalPath = this.GetLocalPathForStickerId256(storeProduct, stickerId) }); if (ScaleFactor.GetScaleFactor() == 100) { downloadList.Add(new RemoteLocalMapping() { RemoteUri = baseUrl + (object)stickerId + "/128b.png", LocalPath = this.GetLocalPathForStickerId128(storeProduct, stickerId) }); } } downloadList.Add(new RemoteLocalMapping() { RemoteUri = storeProduct.base_url + "/background.png", LocalPath = storeProduct.id.ToString() + "background.png" }); BatchDownloadManager.GetDownloadManager(storeProduct.id.ToString(), downloadList).Start(); }
// Use this for initialization void Start() { audioplay.PlayGameOver(); AudioScript.status = false; var scaleFactor = ScaleFactor.GetScaleFactor(); //home var menuButton = UIButton.create(buttonsManager, "home_normal.png", "home_active.png", 0, 0); menuButton.highlightedTouchOffsets = new UIEdgeOffsets(30); menuButton.onTouchUpInside += sender => Application.LoadLevel("AGAIN"); menuButton.onTouchUpInside += sender => AudioScript.status = false; menuButton.touchDownSound = audioplay.getSoundClip(); menuButton.setSize(menuButton.width / scaleFactor * 0.8f, menuButton.height / scaleFactor * 0.8f); menuButton.positionFromCenter(0.26f, -0.10f); //retry var retryButton = UIButton.create(buttonsManager, "retry_normal.png", "retry.png", 0, 0); retryButton.highlightedTouchOffsets = new UIEdgeOffsets(30); retryButton.onTouchUpInside += sender => Application.LoadLevel("Level1"); retryButton.onTouchUpInside += sender => AudioScript.status = true; retryButton.touchDownSound = audioplay.getSoundClip(); retryButton.setSize(retryButton.width / scaleFactor + 27, retryButton.height / scaleFactor + 18); menuButton.positionFromCenter(0.26f, -0.13f); retryButton.parentUIObject = menuButton; retryButton.positionFromCenter(0f, 2f); }
public ImageEditorDecorator2UC() { CubicEase cubicEase = new CubicEase(); int num = 0; ((EasingFunctionBase)cubicEase).EasingMode = ((EasingMode)num); this._easing = (IEasingFunction)cubicEase; this._imageSizes = new List <Size>(); this._scrollMediator = new ScrollViewerOffsetMediator(); //base.\u002Ector(); this.InitializeComponent(); ((FrameworkElement)this).DataContext = ((object)this); ((UIElement)this).Visibility = Visibility.Collapsed; this.imageViewer.HideCallback = (Action)(() => this.Hide(false)); this.imageViewer.ChangeIndexBeforeAnimation = true; this.imageViewer.MaxScale = 8.0; this.imageViewer.CurrentIndexChanged = new Action(this.RespondToCurrentIndexChanged); this.imageViewer.IsInVerticalSwipeChanged = new Action(this.RespondToVertSwipeChange); this.imageViewer.SupportOrientationChange = false; this._scrollMediator.ScrollViewer = this.scrollFilters; if (ScaleFactor.GetScaleFactor() != 150) { return; } ((FrameworkElement)this.LayoutRoot).Height = (854.0); ((FrameworkElement)this.imageViewer).Height = (782.0); }
void Start() { level = Main.getLevel(); audioplay.PlayLevelComplete(); var scaleFactor = ScaleFactor.GetScaleFactor(); menuButton = UIButton.create(buttonsManager, "menu_normal.png", "menu.png", 0, 0); menuButton.positionFromBottomLeft(0.29f, -0.12f); menuButton.setSize(menuButton.width / scaleFactor + 10, menuButton.height / scaleFactor + 15); menuButton.highlightedTouchOffsets = new UIEdgeOffsets(30); menuButton.onTouchUpInside += sender => Application.LoadLevel("AGAIN"); menuButton.onTouchUpInside += sender => AudioScript.status = false; menuButton.touchDownSound = audioplay.getSoundClip(); AudioScript.status = false; if (level <= 10) { nextButton = UIButton.create(buttonsManager, "next_normal.png", "next.png", 0, 0); nextButton.highlightedTouchOffsets = new UIEdgeOffsets(30); nextButton.setSize(nextButton.width / scaleFactor * 1f, nextButton.height / scaleFactor * 1.1f); nextButton.onTouchUpInside += sender => Application.LoadLevel("Level" + level); nextButton.onTouchUpInside += sender => AudioScript.status = true; nextButton.touchDownSound = audioplay.getSoundClip(); } menuButton.positionFromCenter(0.29f, -0.12f); nextButton.parentUIObject = menuButton; nextButton.positionFromCenter(0f, 2f); }
public string GetLocalPathForStickerId128(string baseUri, int stickerId) { if (ScaleFactor.GetScaleFactor() != 100) { return(this.GetLocalPathForStickerId256(baseUri, stickerId)); } return(baseUri + (object)stickerId + "/128b.png?" + VeryLowProfileImageLoader.REQUIRE_CACHING_KEY + "=True"); }
public ImageEditorViewModel() { this._sessionId = Guid.NewGuid(); this.EnsureFolder(); this._sessionEffectsInfo = new SessionEffects(); this._viewportSize = ScaleFactor.GetScaleFactor() != 150 ? new Size((double)(480 * ScaleFactor.GetScaleFactor() / 100), (double)(800 * ScaleFactor.GetScaleFactor() / 100)) : new Size(720.0, 1280.0); this._currentEffects = new ImageEffectsInfo(); }
private void TryReadStickerData(string resourceUri, int dimension) { if (!string.IsNullOrWhiteSpace(resourceUri)) { this.ResourceUri = resourceUri; this._stickerDimension = (double)(dimension * 100 / ScaleFactor.GetScaleFactor()); } if (this._stickerDimension < 200.0) { return; } this._stickerDimension = this._stickerDimension / 1.5; }
// Use this for initialization void Start() { var scaleFactor = ScaleFactor.GetScaleFactor(); scoreText = new UIText(textManager, "VogueCyrBold_60_ffffff", "VogueCyrBold_60_ffffff.png"); scoretext1 = scoreText.addTextInstance(string.Format("{0}", Main.getScore()), 0, 0); scoretext1.color = Color.black; scoretext1.textScale /= scaleFactor * 0.4f; if (Application.loadedLevelName != "gameOver") { scoretext2 = scoreText.addTextInstance(string.Format("{0}", Main.getTargetScore()), 0, 0); scoretext2.positionFromCenter(0.17f, 0.0f); scoretext2.color = Color.black; } scoretext1.positionFromCenter(0.0f, 0.0f); }
// Use this for initialization void Start() { var scaleFactor = ScaleFactor.GetScaleFactor(); //high score var CloseBtn = UIButton.create(highscoreManager, "back_normal2.png", "back_active2.png", 0, 0); CloseBtn.highlightedTouchOffsets = new UIEdgeOffsets(30); CloseBtn.onTouchUpInside += sender => Application.LoadLevel("AGAIN"); CloseBtn.touchDownSound = audioplay.getSoundClip(); CloseBtn.positionFromCenter(0.18f, 0.05f); CloseBtn.setSize(CloseBtn.width / scaleFactor * 1f, CloseBtn.height / scaleFactor * 1f); highScore = Main.getHighScore(); highScoreText = new UIText(textManager, "VogueCyrBold_60_ffffff", "VogueCyrBold_60_ffffff.png"); highscoretext = highScoreText.addTextInstance(string.Format("{0}", highScore), 0, 0); highscoretext.textScale /= scaleFactor * 0.4f; highscoretext.positionFromCenter(-0.03f, 0.01f); highscoretext.color = Color.black; }
// pause Button Function void Start() { Time.timeScale = 1; scaleFactor = ScaleFactor.GetScaleFactor(); pauseButton = UIButton.create(buttonsManager, "pause_active2.png", "pause_normal2.png", 0, 0); resumeButton = UIButton.create(buttonsManager, "play_active.png", "play_normal2.png", 0, 0); replayButton = UIButton.create(buttonsManager, "resume_normal.png", "resume_active.png", 0, 0); homeButton = UIButton.create(buttonsManager, "home_normal.png", "home_active.png", 0, 0); pauseDefaultx = pauseButton.width / scaleFactor * 1f; pauseDefaultY = pauseButton.height / scaleFactor * 1f; pauseButton.positionFromTopLeft(0.24f, 0.9f); pauseButton.setSize(pauseButton.width / scaleFactor * 1f, pauseButton.height / scaleFactor * 1f); resumeButton.setSize(resumeButton.width / scaleFactor * 1f, resumeButton.height / scaleFactor * 1f); replayButton.setSize(replayButton.width / scaleFactor * 1f, replayButton.height / scaleFactor * 1f); homeButton.setSize(homeButton.width / scaleFactor * 1f, homeButton.height / scaleFactor * 1f); currentPosX = objectCamera.transform.position.x; currentPosY = objectCamera.transform.position.y; currentPosZ = objectCamera.transform.position.z; pauseButton.onTouchUpInside += sender3 => Time.timeScale = 0; replayButton.onTouchUpInside += sender1 => Application.LoadLevel("Level1"); replayButton.onTouchUpInside += sender1 => audioplay.PlayGameMusic(); replayButton.onTouchUpInside += sender1 => AudioScript.status = false; homeButton.onTouchUpInside += sender2 => Application.LoadLevel("AGAIN"); resumeButton.onTouchUpInside += sender3 => Time.timeScale = 1; pauseButton.touchDownSound = audioplay.getSoundClip(); replayButton.touchDownSound = audioplay.getSoundClip(); homeButton.touchDownSound = audioplay.getSoundClip(); resumeButton.touchDownSound = audioplay.getSoundClip(); replayButton.positionFromTopLeft(2f, 2f); homeButton.positionFromTopLeft(2f, 2f); resumeButton.positionFromTopLeft(2f, 2f); }
// Use this for initialization void Start() { print("Width " + Screen.width + " Height " + Screen.height); var scaleFactor = ScaleFactor.GetScaleFactor(); //game collection var backButton = UIButton.create("back_normal2.png", "back_active2.png", 0, 0); backButton.highlightedTouchOffsets = new UIEdgeOffsets(30); backButton.touchDownSound = audioplay.getSoundClip();; backButton.setSize(backButton.width / scaleFactor + 6, backButton.height / scaleFactor + 11); backButton.onTouchUpInside += sender => Application.LoadLevel("AGAIN"); var storeButton = UIButton.create("store_normal.png", "store_active.png", 0, 0); storeButton.highlightedTouchOffsets = new UIEdgeOffsets(30); storeButton.touchDownSound = audioplay.getSoundClip();; storeButton.setSize(storeButton.width / scaleFactor, storeButton.height / scaleFactor * 0.98f); storeButton.onTouchUpInside += sender => Application.LoadLevel("gameStore"); backButton.positionFromCenter(0.305f, -0.15f); storeButton.parentUIObject = backButton; storeButton.positionFromBottomLeft(0f, 1.3f); }
// Use this for initialization void Start() { var scaleFactor = ScaleFactor.GetScaleFactor(); //home var source = UIButton.create(creditsManager, "back_normal2.png", "back_active2.png", 0, 0); source.setSize(source.width / scaleFactor, source.height / scaleFactor); source.onTouchUpInside += sender => Application.LoadLevel("AGAIN"); source.touchDownSound = audioplay.getSoundClip(); var CloseBtn = UIButton.create(creditsManager, "back_normal2.png", "back_active2.png", 0, 0); CloseBtn.userData = "Click"; CloseBtn.setSize(CloseBtn.width / scaleFactor, CloseBtn.height / scaleFactor); CloseBtn.onTouchUpInside += sender => Application.LoadLevel("AGAIN"); CloseBtn.touchDownSound = audioplay.getSoundClip(); source.positionFromCenter(0.6f, 0.0f); CloseBtn.parentUIObject = source; CloseBtn.positionFromCenter(-8f, 0.0f); }
//game store void Start() { AudioScript.status = true; var scaleFactor = ScaleFactor.GetScaleFactor(); var backButton = UIButton.create(backManager, "back_normal2.png", "back_active2.png", 0, 0); backButton.highlightedTouchOffsets = new UIEdgeOffsets(30); backButton.touchDownSound = audioplay.getSoundClip(); backButton.onTouchUpInside += sender => Application.LoadLevel("AGAIN"); backButton.positionFromCenter(0.43f, 0.05f); backButton.setSize(backButton.width / scaleFactor * 1f, backButton.height / scaleFactor * 1f); var scrollable = new UIScrollableVerticalLayout(10); scrollable.alignMode = UIAbstractContainer.UIContainerAlignMode.Center; scrollable.parentUIObject = backButton; scrollable.positionFromCenter(-12.5f, -2.2f); scrollable.setSize(Screen.width / 1.1f, Screen.height / 1.7f); for (var i = 0; i < 15; i++) { UIButton touchable; if (i == 4) // text sprite { touchable = UIButton.create(storeManager, "4.png", "4.png", 0, 0); touchable.setSize(touchable.width / scaleFactor - 50f, touchable.height / scaleFactor - 20f); touchable.userData = "Click"; touchable.onTouchUpInside += (sender) => Application.LoadLevel("shortcuts"); touchable.onTouchUp += OnButtonUp; touchable.onTouchDown += OnButtonDown; touchable.onTouchUpInside += OnButtonSelect; touchable.parentUIObject = scrollable; } else if (i % 3 == 0) { touchable = UIButton.create("3.png", "3.png", 0, 0); touchable.setSize(touchable.width / scaleFactor - 50f, touchable.height / scaleFactor - 20f); touchable.onTouchUpInside += (sender) => Application.LoadLevel("shortcuts"); touchable.onTouchUp += OnButtonUp; touchable.onTouchDown += OnButtonDown; touchable.onTouchUpInside += OnButtonSelect; touchable.parentUIObject = scrollable; } else if (i % 2 == 0) { touchable = UIButton.create("2.png", "2.png", 0, 0); touchable.setSize(touchable.width / scaleFactor - 50f, touchable.height / scaleFactor - 20f); touchable.onTouchUpInside += (sender) => Application.LoadLevel("shortcuts"); touchable.onTouchUp += OnButtonUp; touchable.onTouchDown += OnButtonDown; touchable.onTouchUpInside += OnButtonSelect; touchable.parentUIObject = scrollable; } else { touchable = UIButton.create("1.png", "1.png", 0, 0); touchable.setSize(touchable.width / scaleFactor - 50f, touchable.height / scaleFactor - 20f); touchable.onTouchUpInside += (sender) => Application.LoadLevel("shortcuts"); touchable.onTouchUp += OnButtonUp; touchable.onTouchDown += OnButtonDown; touchable.onTouchUpInside += OnButtonSelect; touchable.parentUIObject = scrollable; } scrollable.addChild(touchable); } }
// Use this for initialization void Start() { audioplay = GameObject.FindGameObjectWithTag("SoundLoader").GetComponent <AudioScript>(); if (AudioScript.status == false) { audioplay.PlayMenuMusic(); } var scaleFactor = ScaleFactor.GetScaleFactor(); Time.timeScale = 1; print("Width " + Screen.width + " Height " + Screen.height); //main menu //play game playButton = UIButton.create("PlayBtn_normal.png", "PlayBtn_active.png", 0, 0); playButton.setSize(playButton.width / scaleFactor, playButton.height / scaleFactor); playButton.onTouchUpInside += sender => Application.LoadLevel("Loading"); //view collections of toy darts collectionButton = UIButton.create("CollectionBtn_normal.png", "CollectionBtn_active.png", 0, 0); collectionButton.onTouchUpInside += sender => Application.LoadLevel("collections"); collectionButton.setSize(collectionButton.width / scaleFactor, collectionButton.height / scaleFactor); //store storeButton = UIButton.create("StoreBtn_normal.png", "StoreBtn_active.png", 0, 0); storeButton.onTouchUpInside += sender => Application.LoadLevel("gameStore"); storeButton.setSize(storeButton.width / scaleFactor, storeButton.height / scaleFactor); //high score highScoreButton = UIButton.create("HighScoBtn_normal.png", "HighScoBtn_active.png", 0, 0); highScoreButton.onTouchUpInside += sender => Application.LoadLevel("HS");; highScoreButton.setSize(highScoreButton.width / scaleFactor, highScoreButton.height / scaleFactor); //credits creditsButton = UIButton.create("CreditsBtn_normal.png", "CreditsBtn_activel.png", 0, 0); creditsButton.onTouchUpInside += sender => Application.LoadLevel("credits"); creditsButton.setSize(creditsButton.width / scaleFactor, creditsButton.height / scaleFactor); //post post = UIButton.create("post.png", "post.png", 0, 0); post.setSize(post.width / scaleFactor, post.height / scaleFactor); //sound sound = UIToggleButton.create("sound_normal.png", "sound_mute.png", "sound_active.png", 0, 0); sound.onToggle += (sender, selected) => toggleSound(sender); sound.selected = false; sound.setSize(sound.width / scaleFactor, sound.height / scaleFactor); //music music = UIToggleButton.create("music_normal.png", "music_mute.png", "music_active.png", 0, 0); music.onToggle += (sender, selected) => toggleMusic(sender); music.selected = false; music.setSize(music.width / scaleFactor, music.height / scaleFactor); help = UIButton.create("HelpBtn.png", "HelpBtn.png", 0, 0); help.onTouchUpInside += sender => x++; help.onTouchUpInside += sender => showTutorial(); help.setSize(help.width / scaleFactor, help.height / scaleFactor); originalPosition(); }
// Use this for initialization void Start() { audioplay = GameObject.FindGameObjectWithTag("SoundLoader").GetComponent <AudioScript>(); var scaleFactor = ScaleFactor.GetScaleFactor(); var backButton = UIButton.create(buttonsManager2, "CloseBtn.png", "CloseBtn.png", 0, 0); backButton.onTouchUpInside += sender => Application.LoadLevel("AGAIN"); backButton.positionFromCenter(-0.42f, 0.355f); backButton.setSize(backButton.width / scaleFactor * 1f, backButton.height / scaleFactor * 1f); Level1 = UIButton.create(buttonsManager, "L1.png", "L1.png", 0, 0); Level1.setSize(Level1.width / scaleFactor, Level1.height / scaleFactor); Level1.onTouchUpInside += sender => Application.LoadLevel("Level1"); Level2 = UIButton.create(buttonsManager, "L2.png", "L2.png", 0, 0); Level2.setSize(Level2.width / scaleFactor, Level2.height / scaleFactor); Level2.onTouchUpInside += sender => Application.LoadLevel("Level2"); Level2.onTouchUpInside += sender => Basket.levelShortcutSet(0); Level3 = UIButton.create(buttonsManager, "L3.png", "L3.png", 0, 0); Level3.setSize(Level3.width / scaleFactor, Level3.height / scaleFactor); Level3.onTouchUpInside += sender => Application.LoadLevel("Level3"); Level3.onTouchUpInside += sender => Basket.levelShortcutSet(0); Level4 = UIButton.create(buttonsManager, "L4.png", "L4.png", 0, 0); Level4.setSize(Level4.width / scaleFactor, Level4.height / scaleFactor); Level4.onTouchUpInside += sender => Application.LoadLevel("Level4"); Level4.onTouchUpInside += sender => Basket.levelShortcutSet(0); Level5 = UIButton.create(buttonsManager, "L5.png", "L5.png", 0, 0); Level5.setSize(Level5.width / scaleFactor, Level5.height / scaleFactor); Level5.onTouchUpInside += sender => Application.LoadLevel("Level5"); Level5.onTouchUpInside += sender => Basket.levelShortcutSet(0); Level6 = UIButton.create(buttonsManager, "L6.png", "L6.png", 0, 0); Level6.setSize(Level6.width / scaleFactor, Level6.height / scaleFactor); Level6.onTouchUpInside += sender => Application.LoadLevel("Level6"); Level6.onTouchUpInside += sender => Basket.levelShortcutSet(0); Level7 = UIButton.create(buttonsManager, "L7.png", "L7.png", 0, 0); Level7.setSize(Level7.width / scaleFactor, Level7.height / scaleFactor); Level7.onTouchUpInside += sender => Application.LoadLevel("Level7"); Level7.onTouchUpInside += sender => Basket.levelShortcutSet(0); Level8 = UIButton.create(buttonsManager, "L8.png", "L8.png", 0, 0); Level8.setSize(Level8.width / scaleFactor, Level8.height / scaleFactor); Level8.onTouchUpInside += sender => Application.LoadLevel("Level8"); Level8.onTouchUpInside += sender => Basket.levelShortcutSet(0); Level9 = UIButton.create(buttonsManager, "L9.png", "L9.png", 0, 0); Level9.setSize(Level9.width / scaleFactor, Level9.height / scaleFactor); Level9.onTouchUpInside += sender => Application.LoadLevel("Level9"); Level9.onTouchUpInside += sender => Basket.levelShortcutSet(0); Level10 = UIButton.create(buttonsManager, "L10.png", "L10.png", 0, 0); Level10.setSize(Level10.width / scaleFactor, Level10.height / scaleFactor); Level10.onTouchUpInside += sender => Application.LoadLevel("Level10"); Level10.onTouchUpInside += sender => Basket.levelShortcutSet(0); Level1.positionFromCenter(-0.4f, 0f); Level2.parentUIObject = Level1; Level2.positionFromCenter(1.1f, 0f); Level3.parentUIObject = Level2; Level3.positionFromCenter(1.1f, 0f); Level4.parentUIObject = Level3; Level4.positionFromCenter(1.1f, 0f); Level5.parentUIObject = Level4; Level5.positionFromCenter(1.1f, 0f); Level6.parentUIObject = Level5; Level6.positionFromCenter(1.1f, 0f); Level7.parentUIObject = Level6; Level7.positionFromCenter(1.1f, 0f); Level8.parentUIObject = Level7; Level8.positionFromCenter(1.1f, 0f); Level9.parentUIObject = Level8; Level9.positionFromCenter(1.1f, 0f); Level10.parentUIObject = Level9; Level10.positionFromCenter(1.1f, 0f); Level1.touchDownSound = audioplay.getSoundClip(); Level2.touchDownSound = audioplay.getSoundClip(); Level3.touchDownSound = audioplay.getSoundClip(); Level4.touchDownSound = audioplay.getSoundClip(); Level5.touchDownSound = audioplay.getSoundClip(); Level6.touchDownSound = audioplay.getSoundClip(); Level7.touchDownSound = audioplay.getSoundClip(); Level8.touchDownSound = audioplay.getSoundClip(); Level9.touchDownSound = audioplay.getSoundClip(); Level10.touchDownSound = audioplay.getSoundClip(); backButton.touchDownSound = audioplay.getSoundClip(); }
private void ToggleCropMode() { if (this._isInSetResetCrop) { return; } if (this._inCropMode) { this._inCropMode = false; this._inSelectOwnPhotoArea = false; ((UIElement)this.gridChooseThumbnail).Visibility = Visibility.Collapsed; ((UIElement)this.gridCropLines).Visibility = Visibility.Collapsed; ((UIElement)this.gridCrop).Visibility = Visibility.Collapsed; this.imageViewer.Mode = ImageViewerMode.Normal; ((UIElement)this.stackPanelEffects).Visibility = Visibility.Visible; ((UIElement)this.stackPanelCrop).Visibility = Visibility.Collapsed; this.UpdateImageAndEllipseSelectOpacity(1); } else { this._inCropMode = true; Picture galleryImage = this._imageEditorVM.GetGalleryImage(this._albumId, this.CurrentPhotoSeqNo); bool rotated90 = false; Size correctImageSize = this._imageEditorVM.GetCorrectImageSize(galleryImage, this._albumId, this.CurrentPhotoSeqNo, out rotated90); BitmapImage bitmapImage = new BitmapImage(); Point point = new Point(); Size viewportSize = this._imageEditorVM.ViewportSize; // ISSUE: explicit reference operation double num1 = ((Size)@viewportSize).Width * 2.0; viewportSize = this._imageEditorVM.ViewportSize; // ISSUE: explicit reference operation double num2 = ((Size)@viewportSize).Height * 2.0; Size size = new Size(num1, num2); Rect fit1 = RectangleUtils.ResizeToFit(new Rect(point, size), correctImageSize); // ISSUE: explicit reference operation if (((Rect)@fit1).Height < (double)galleryImage.Height) { // ISSUE: explicit reference operation // ISSUE: explicit reference operation bitmapImage.DecodePixelHeight = (rotated90 ? (int)((Rect)@fit1).Height : (int)((Rect)@fit1).Width); } ((BitmapSource)bitmapImage).SetSource(galleryImage.GetImage()); this.imageViewer.CurrentImage.Source = ((ImageSource)this._imageEditorVM.RotateIfNeeded(this._albumId, this.CurrentPhotoSeqNo, new WriteableBitmap((BitmapSource)bitmapImage))); this.imageViewer.RectangleFill = ScaleFactor.GetScaleFactor() != 150 ? new Rect(12.0, 136.0, 456.0, 456.0) : new Rect(12.0, 163.0, 456.0, 456.0); this.imageViewer.Mode = ImageViewerMode.RectangleFill; ImageEffectsInfo imageEffectsInfo = this._imageEditorVM.GetImageEffectsInfo(this._albumId, this.CurrentPhotoSeqNo); if (imageEffectsInfo.CropRect != null) { Rect rect1 = new Rect(); // ISSUE: explicit reference operation rect1.X = ((double)imageEffectsInfo.CropRect.X); // ISSUE: explicit reference operation rect1.Y = ((double)imageEffectsInfo.CropRect.Y); // ISSUE: explicit reference operation rect1.Width = ((double)imageEffectsInfo.CropRect.Width); // ISSUE: explicit reference operation rect1.Height = ((double)imageEffectsInfo.CropRect.Height); Rect rect2 = rect1; Rect fit2 = RectangleUtils.ResizeToFit(new Rect(new Point(), new Size(((FrameworkElement)this.imageViewer).Width, ((FrameworkElement)this.imageViewer).Height)), correctImageSize); ((UIElement)this.imageViewer.CurrentImage).RenderTransform = ((Transform)RectangleUtils.TransformRect(((GeneralTransform)RectangleUtils.TransformRect(new Rect(new Point(), correctImageSize), fit2, false)).TransformBounds(rect2), this.imageViewer.RectangleFill, false)); } else { this.imageViewer.AnimateToRectangleFill(); } galleryImage.Dispose(); this.ShowHideGridFilters(false); ((UIElement)this.gridCropLines).Visibility = Visibility.Visible; ((UIElement)this.gridCrop).Visibility = Visibility.Visible; ((UIElement)this.stackPanelEffects).Visibility = Visibility.Collapsed; ((UIElement)this.stackPanelCrop).Visibility = Visibility.Visible; this.UpdateImageAndEllipseSelectOpacity(0); } }