public void LoadFrameImage() { if (DataContext is CharacterFrameEditorViewModel viewModel) { if (viewModel.CharacterModel == null) { return; } WriteableBitmap frameBitmap = CharacterUtils.CreateImage(viewModel.CharacterModel, viewModel.AnimationIndex, viewModel.FrameIndex, ref CharacterViewModel.GroupedPalettes); if (frameBitmap != null) { frameView.FrameImage = frameBitmap; } } }
public void LoadFrameImage() { if (CharacterModel == null || _animationIndex == -1) { return; } if (_reloadImages[FrameIndex] == false) { WriteableBitmap frameBitmap = CharacterUtils.CreateImage(CharacterModel, _animationIndex, FrameIndex, ref CharacterViewModel.GroupedPalettes); if (frameBitmap == null) { return; } _bitmapImages[FrameIndex] = frameBitmap; _reloadImages[FrameIndex] = true; } FrameImage = _bitmapImages[FrameIndex]; }
private void LoadFrameImage() { if (CharacterModel == null) { return; } int animationIndex = -1; for (int i = 0; i < CharacterModel.Animations.Length; ++i) { if (CharacterModel.Animations[i].ID == TabID) { animationIndex = i; break; } } if (animationIndex == -1 || FrameIndex == -1) { return; } if (FrameIndex >= 64) { return; } WriteableBitmap frameBitmap = CharacterUtils.CreateImage(CharacterModel, animationIndex, FrameIndex, ref CharacterViewModel.GroupedPalettes); if (frameBitmap == null) { return; } FrameImage = frameBitmap; }