Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SetInheritedBindingContext and more #95

Merged
merged 9 commits into from
Oct 19, 2024
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
4 changes: 2 additions & 2 deletions dev/github_uploadnugets.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ REM Define the source directory for the packages
set "source_dir=E:\Nugets"

REM Define the file mask for the packages
set "file_mask=DrawnUi.Maui*.1.2.3.6*.nupkg"
REM set "file_mask=AppoMobi.Maui.DrawnUi.1.2.3.6*.*nupkg"
REM set "file_mask=DrawnUi.Maui*.1.2.3.8*.nupkg"
set "file_mask=AppoMobi.Maui.DrawnUi.1.2.3.8*.*nupkg"

REM Loop through each package file in the source directory
for %%f in ("%source_dir%\%file_mask%") do (
Expand Down
4 changes: 2 additions & 2 deletions dev/nuget_uploadnugets.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ REM Define the source directory for the packages
set "source_dir=E:\Nugets"

REM Define the file mask for the packages
set "file_mask=DrawnUi.Maui*.1.2.3.6*.nupkg"
REM set "file_mask=AppoMobi.Maui.DrawnUi.1.2.3.6*.*nupkg"
REM set "file_mask=DrawnUi.Maui*.1.2.3.8*.nupkg"
set "file_mask=AppoMobi.Maui.DrawnUi.1.2.3.8*.*nupkg"

REM Loop through each package file in the source directory
for %%f in ("%source_dir%\%file_mask%") do (
Expand Down
77 changes: 38 additions & 39 deletions src/Addons/DrawnUi.Maui.Camera/Platforms/Android/NativeCamera.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@

namespace DrawnUi.Maui.Camera;


public partial class NativeCamera : Java.Lang.Object, ImageReader.IOnImageAvailableListener, INativeCamera
{
public void SetZoom(float zoom)
Expand Down Expand Up @@ -904,22 +903,22 @@ bool SetupCamera(CameraUnit cameraUnit)

switch (FormsControl.CapturePhotoQuality)
{
case CaptureQuality.Max:
selectedSize = validSizes.First();
break;
case CaptureQuality.Max:
selectedSize = validSizes.First();
break;

case CaptureQuality.Medium:
selectedSize = validSizes[validSizes.Count / 3];
break;
case CaptureQuality.Medium:
selectedSize = validSizes[validSizes.Count / 3];
break;

case CaptureQuality.Low:
selectedSize = validSizes.Last();
break;
case CaptureQuality.Low:
selectedSize = validSizes.Last();
break;

default:
//todo: handle case of Preview
selectedSize = new(1, 1);
break;
default:
//todo: handle case of Preview
selectedSize = new(1, 1);
break;
}

CaptureWidth = selectedSize.Width;
Expand Down Expand Up @@ -1082,15 +1081,15 @@ public CameraProcessorState State
{
switch (value)
{
case CameraProcessorState.Enabled:
FormsControl.State = CameraState.On;
break;
case CameraProcessorState.Error:
FormsControl.State = CameraState.Error;
break;
default:
FormsControl.State = CameraState.Off;
break;
case CameraProcessorState.Enabled:
FormsControl.State = CameraState.On;
break;
case CameraProcessorState.Error:
FormsControl.State = CameraState.Error;
break;
default:
FormsControl.State = CameraState.Off;
break;
}
}
}
Expand Down Expand Up @@ -1756,22 +1755,22 @@ public void OnCapturedImage(Image image)

switch (FormsControl.DeviceRotation)
{
case 90:
FormsControl.CameraDevice.Meta.Orientation = 8;
//newexif.SetAttribute(ExifInterface.TagOrientation, "6");
break;
case 270:
FormsControl.CameraDevice.Meta.Orientation = 6;
//newexif.SetAttribute(ExifInterface.TagOrientation, "8");
break;
case 180:
FormsControl.CameraDevice.Meta.Orientation = 3;
//newexif.SetAttribute(ExifInterface.TagOrientation, "3");
break;
default:
FormsControl.CameraDevice.Meta.Orientation = 1;
//newexif.SetAttribute(ExifInterface.TagOrientation, "1");
break;
case 90:
FormsControl.CameraDevice.Meta.Orientation = 8;
//newexif.SetAttribute(ExifInterface.TagOrientation, "6");
break;
case 270:
FormsControl.CameraDevice.Meta.Orientation = 6;
//newexif.SetAttribute(ExifInterface.TagOrientation, "8");
break;
case 180:
FormsControl.CameraDevice.Meta.Orientation = 3;
//newexif.SetAttribute(ExifInterface.TagOrientation, "3");
break;
default:
FormsControl.CameraDevice.Meta.Orientation = 1;
//newexif.SetAttribute(ExifInterface.TagOrientation, "1");
break;
}

var outImage = new CapturedImage()
Expand Down
56 changes: 29 additions & 27 deletions src/Addons/DrawnUi.Maui.Camera/SkiaCamera.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ namespace DrawnUi.Maui.Camera;
public partial class SkiaCamera : SkiaControl
{

public override bool CanUseCacheDoubleBuffering => false;

#if (!ANDROID && !IOS && !MACCATALYST && !WINDOWS && !TIZEN)

public virtual void SetZoom(double value)
Expand Down Expand Up @@ -276,33 +278,33 @@ SKBitmap Reorient()

switch (captured.Orientation)
{
case 180:
using (var surface = new SKCanvas(bitmap))
{
surface.RotateDegrees(180, bitmap.Width / 2.0f, bitmap.Height / 2.0f);
surface.DrawBitmap(bitmap.Copy(), 0, 0);
}
return bitmap;
case 270:
rotated = new SKBitmap(bitmap.Height, bitmap.Width);
using (var surface = new SKCanvas(rotated))
{
surface.Translate(rotated.Width, 0);
surface.RotateDegrees(90);
surface.DrawBitmap(bitmap, 0, 0);
}
return rotated;
case 90:
rotated = new SKBitmap(bitmap.Height, bitmap.Width);
using (var surface = new SKCanvas(rotated))
{
surface.Translate(0, rotated.Height);
surface.RotateDegrees(270);
surface.DrawBitmap(bitmap, 0, 0);
}
return rotated;
default:
return bitmap;
case 180:
using (var surface = new SKCanvas(bitmap))
{
surface.RotateDegrees(180, bitmap.Width / 2.0f, bitmap.Height / 2.0f);
surface.DrawBitmap(bitmap.Copy(), 0, 0);
}
return bitmap;
case 270:
rotated = new SKBitmap(bitmap.Height, bitmap.Width);
using (var surface = new SKCanvas(rotated))
{
surface.Translate(rotated.Width, 0);
surface.RotateDegrees(90);
surface.DrawBitmap(bitmap, 0, 0);
}
return rotated;
case 90:
rotated = new SKBitmap(bitmap.Height, bitmap.Width);
using (var surface = new SKCanvas(rotated))
{
surface.Translate(0, rotated.Height);
surface.RotateDegrees(270);
surface.DrawBitmap(bitmap, 0, 0);
}
return rotated;
default:
return bitmap;
}
}
}
Expand Down
File renamed without changes.
18 changes: 18 additions & 0 deletions src/DrawnUi.Maui.sln
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DrawnUi.Maui.Camera", "Addo
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SomeMauiApp", "..\..\AppoMobi.Maui.DrawnUi.Demo\src\Usual\SomeMauiApp.csproj", "{F71645D2-F7AF-4C1C-9509-D01692622110}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DrawFrameInMaui", "..\..\DrawFrameInMaui\DrawFrameInMaui.csproj", "{09FF4C40-E913-4148-B965-B5475DFD3B53}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppoMobi.Maui.DrawnUi.Demo", "..\..\AppoMobi.Maui.DrawnUi.Demo\src\AllDrawn\AppoMobi.Maui.DrawnUi.Demo.csproj", "{9DCB6C22-2F92-4D59-B23E-0AD6EC233D1F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -87,6 +91,18 @@ Global
{F71645D2-F7AF-4C1C-9509-D01692622110}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F71645D2-F7AF-4C1C-9509-D01692622110}.Release|Any CPU.Build.0 = Release|Any CPU
{F71645D2-F7AF-4C1C-9509-D01692622110}.Release|Any CPU.Deploy.0 = Release|Any CPU
{09FF4C40-E913-4148-B965-B5475DFD3B53}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{09FF4C40-E913-4148-B965-B5475DFD3B53}.Debug|Any CPU.Build.0 = Debug|Any CPU
{09FF4C40-E913-4148-B965-B5475DFD3B53}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{09FF4C40-E913-4148-B965-B5475DFD3B53}.Release|Any CPU.ActiveCfg = Release|Any CPU
{09FF4C40-E913-4148-B965-B5475DFD3B53}.Release|Any CPU.Build.0 = Release|Any CPU
{09FF4C40-E913-4148-B965-B5475DFD3B53}.Release|Any CPU.Deploy.0 = Release|Any CPU
{9DCB6C22-2F92-4D59-B23E-0AD6EC233D1F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9DCB6C22-2F92-4D59-B23E-0AD6EC233D1F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9DCB6C22-2F92-4D59-B23E-0AD6EC233D1F}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{9DCB6C22-2F92-4D59-B23E-0AD6EC233D1F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9DCB6C22-2F92-4D59-B23E-0AD6EC233D1F}.Release|Any CPU.Build.0 = Release|Any CPU
{9DCB6C22-2F92-4D59-B23E-0AD6EC233D1F}.Release|Any CPU.Deploy.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -102,6 +118,8 @@ Global
{1F524822-400E-4801-AE05-4B3A14B603AD} = {8B60E2B6-4347-450E-9999-319D8C7697D3}
{D4FC0BDB-3FE8-49C9-8B76-53C83128B899} = {8B60E2B6-4347-450E-9999-319D8C7697D3}
{F71645D2-F7AF-4C1C-9509-D01692622110} = {0DDE4AC1-3D8B-42C8-88F2-6F45B89F72F2}
{09FF4C40-E913-4148-B965-B5475DFD3B53} = {0DDE4AC1-3D8B-42C8-88F2-6F45B89F72F2}
{9DCB6C22-2F92-4D59-B23E-0AD6EC233D1F} = {0DDE4AC1-3D8B-42C8-88F2-6F45B89F72F2}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {08E673B7-06BF-468C-8D6C-2D1AA8E4A8CA}
Expand Down
Loading
Loading