Skip to content

Commit f4a267b

Browse files
authored
Merge pull request #7 from BitooBit/develop
Develop
2 parents 8d7fe43 + 1c1315f commit f4a267b

7 files changed

Lines changed: 5 additions & 17 deletions

File tree

ImageEditor.jpeg

-698 KB
Binary file not shown.

ImageEditor.jpg

84.1 KB
Loading
-634 KB
Binary file not shown.
634 KB
Binary file not shown.

src/BitooBitImageEditor/EditorPage/ImageEditorViewModel.cs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using System.Collections.Generic;
99
using System.Collections.ObjectModel;
1010
using System.IO;
11+
using System.Reflection;
1112
using System.Windows.Input;
1213
using Xamarin.Forms;
1314

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

33-
//if (config?.Stickers != null)
34-
// foreach (var a in config?.Stickers)
35-
// {
36-
// SKData data = SKImage.FromBitmap(a).Encode();
37-
// using (Stream stream = data.AsStream())
38-
// {
39-
// byte[] imageData = new byte[stream.Length];
40-
// stream.Read(imageData, 0, System.Convert.ToInt32(stream.Length));
41-
// Sources.Add(new SKBitmapImageSource() {Bitmap = a });
42-
43-
// //Sources.Add(ImageSource.FromStream(() => new MemoryStream(imageData)));
44-
// }
45-
// }
46-
4734
GC.Collect();
4835
}
4936

37+
5038
public bool CropVisible => CurrentEditType == ImageEditType.CropRotate;
5139
public bool MainVisible => !CropVisible;
5240
public bool TextVisible => CurrentEditType == ImageEditType.Text;

src/BitooBitImageEditor/ManipulationBitmap/TouchManipulationCanvasView.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public TouchManipulationCanvasView(ImageEditorConfig config)
5252
outImageHeight = config?.OutImageHeight ?? 0;
5353
}
5454
DisplayInfo displayInfo = DeviceDisplay.MainDisplayInfo;
55-
sizeTrash = (float)Math.Min(displayInfo.Height, displayInfo.Width) * 0.04f;
55+
sizeTrash = (float)Math.Max(displayInfo.Height, displayInfo.Width) * 0.06f;
5656

5757
using (Stream streamOpenTrash = GetType().GetTypeInfo().Assembly.GetManifestResourceStream($"{ImageResourceExtension.resource}trash_open.png"))
5858
using (Stream streamTrash = GetType().GetTypeInfo().Assembly.GetManifestResourceStream($"{ImageResourceExtension.resource}trash.png"))
@@ -231,8 +231,9 @@ private void SetTempBitmap()
231231
canvas.Clear();
232232
canvas.DrawBitmap(mainBitmap, backgroundBitmap, outRect, rectMianBitmap, config);
233233
}
234+
tempBitmap?.Dispose();
234235
tempBitmap = outBitmap;
235-
GC.Collect(0);
236+
GC.Collect();
236237
}
237238

238239
private void SetTrashRects(SKImageInfo info)

src/SampleImageEditor/SampleImageEditor/MainPage.xaml.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
using System.Collections.Generic;
66
using System.IO;
77
using System.Reflection;
8-
using System.Windows.Input;
98
using Xamarin.Forms;
109

1110
namespace SampleImageEditor

0 commit comments

Comments
 (0)