Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed ImageEditor.jpeg
Binary file not shown.
Binary file added ImageEditor.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed nuget/BitooBitImageEditor.1.0.1.1.nupkg
Binary file not shown.
Binary file added nuget/BitooBitImageEditor.1.0.1.2.nupkg
Binary file not shown.
16 changes: 2 additions & 14 deletions src/BitooBitImageEditor/EditorPage/ImageEditorViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Reflection;
using System.Windows.Input;
using Xamarin.Forms;

Expand All @@ -30,23 +31,10 @@ internal ImageEditorViewModel(SKBitmap bitmap, ImageEditorConfig config)
ColorCollect = SkiaHelper.GetColors();
CropCollect = CropItem.GetCropItems(config.CanChangeCropAspectRatio);

//if (config?.Stickers != null)
// foreach (var a in config?.Stickers)
// {
// SKData data = SKImage.FromBitmap(a).Encode();
// using (Stream stream = data.AsStream())
// {
// byte[] imageData = new byte[stream.Length];
// stream.Read(imageData, 0, System.Convert.ToInt32(stream.Length));
// Sources.Add(new SKBitmapImageSource() {Bitmap = a });

// //Sources.Add(ImageSource.FromStream(() => new MemoryStream(imageData)));
// }
// }

GC.Collect();
}


public bool CropVisible => CurrentEditType == ImageEditType.CropRotate;
public bool MainVisible => !CropVisible;
public bool TextVisible => CurrentEditType == ImageEditType.Text;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public TouchManipulationCanvasView(ImageEditorConfig config)
outImageHeight = config?.OutImageHeight ?? 0;
}
DisplayInfo displayInfo = DeviceDisplay.MainDisplayInfo;
sizeTrash = (float)Math.Min(displayInfo.Height, displayInfo.Width) * 0.04f;
sizeTrash = (float)Math.Max(displayInfo.Height, displayInfo.Width) * 0.06f;

using (Stream streamOpenTrash = GetType().GetTypeInfo().Assembly.GetManifestResourceStream($"{ImageResourceExtension.resource}trash_open.png"))
using (Stream streamTrash = GetType().GetTypeInfo().Assembly.GetManifestResourceStream($"{ImageResourceExtension.resource}trash.png"))
Expand Down Expand Up @@ -231,8 +231,9 @@ private void SetTempBitmap()
canvas.Clear();
canvas.DrawBitmap(mainBitmap, backgroundBitmap, outRect, rectMianBitmap, config);
}
tempBitmap?.Dispose();
tempBitmap = outBitmap;
GC.Collect(0);
GC.Collect();
}

private void SetTrashRects(SKImageInfo info)
Expand Down
1 change: 0 additions & 1 deletion src/SampleImageEditor/SampleImageEditor/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Windows.Input;
using Xamarin.Forms;

namespace SampleImageEditor
Expand Down