public void UpdateImage(bool updatePreview = true) { Bitmap.Clear(); for (int j = 0; j < Layers.Count; j++) { if (Layers[j] is SmartObjectLayer sol) { Bitmap.AlphaComposite(Layers[j].Texture, new TextureBitmap.Color(255, 255, 255, 255), new TextureBitmap.Point(sol.ObjectX, sol.ObjectY)); } else { Bitmap.AlphaComposite(Layers[j].Texture, new TextureBitmap.Color(255, 255, 255, 255)); } if (TemporaryLayer != null && j == SelectedLayerIndex) { Bitmap.AlphaComposite(TemporaryLayer.Texture, new TextureBitmap.Color(255, 255, 255, 255)); } } Bitmap.Apply(); if (updatePreview) { Pattern.RegeneratePreview(); } Pattern.Bitmap.Replace(this.Bitmap, new TextureBitmap.Color(255, 255, 255, 255), new TextureBitmap.Point(Part.X, Part.Y)); //Pattern.Bitmap.Apply(); Pattern.Editor.OnImageUpdated(); }
private void Render(bool renderEffects = false) { Playground.AlphaComposite(Original, new TextureBitmap.Color(255, 255, 255, 10)); if (renderEffects) { Playground.SetPixel(FoodPosition.X, FoodPosition.Y, new TextureBitmap.Color(255, 255, 255, 255)); } else { Playground.SetPixel(FoodPosition.X, FoodPosition.Y, CurrentFoodColor); } for (int i = 0; i < Points.Count; i++) { if (renderEffects) { Original.SetPixel(Points[i].X, Points[i].Y, Original.GetPixel(Points[i].X, Points[i].Y).AlphaComposite(new TextureBitmap.Color(CurrentSnakeColor.R, CurrentSnakeColor.G, CurrentSnakeColor.B, 20))); } Playground.SetPixel(Points[i].X, Points[i].Y, CurrentSnakeColor); } Playground.Apply(); }
public void Merge(Layer otherLayer) { Texture.AlphaComposite(otherLayer.Texture, new TextureBitmap.Color(255, 255, 255, 255)); }