mirror of
https://gitee.com/csharpui/CPF.git
synced 2025-06-28 13:34:09 +08:00
Merge branch 'master' of https://gitee.com/csharpui/CPF
This commit is contained in:
commit
f8fd529b61
@ -43,7 +43,7 @@ namespace CPF.Skia
|
|||||||
|
|
||||||
var size = new PixelSize((int)Math.Round(cSize.Width * Root.RenderScaling), (int)Math.Round(cSize.Height * Root.RenderScaling));
|
var size = new PixelSize((int)Math.Round(cSize.Width * Root.RenderScaling), (int)Math.Round(cSize.Height * Root.RenderScaling));
|
||||||
var skia = dc as SkiaDrawingContext;
|
var skia = dc as SkiaDrawingContext;
|
||||||
var _gl = skia.GlContext;
|
var _gl = skia?.GlContext;
|
||||||
if (_gl == null)
|
if (_gl == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -126,8 +126,8 @@ namespace CPF.Skia
|
|||||||
BITMAP BITMAP = new BITMAP();
|
BITMAP BITMAP = new BITMAP();
|
||||||
UnmanagedMethods.GetObject(hbitmap, Marshal.SizeOf(typeof(BITMAP)), BITMAP);
|
UnmanagedMethods.GetObject(hbitmap, Marshal.SizeOf(typeof(BITMAP)), BITMAP);
|
||||||
|
|
||||||
var bitmap = new SKBitmap(BITMAP.bmWidth, BITMAP.bmHeight);
|
var bitmap = new SKBitmap();
|
||||||
bitmap.SetPixels(BITMAP.bmBits);
|
bitmap.InstallPixels(new SKImageInfo(BITMAP.bmWidth, BITMAP.bmHeight, SKImageInfo.PlatformColorType), BITMAP.bmBits, BITMAP.bmWidthBytes);
|
||||||
|
|
||||||
this.bitmap = bitmap;
|
this.bitmap = bitmap;
|
||||||
canvas = new SKCanvas(this.bitmap);
|
canvas = new SKCanvas(this.bitmap);
|
||||||
|
@ -52,6 +52,16 @@
|
|||||||
<Reference Include="System.Drawing" />
|
<Reference Include="System.Drawing" />
|
||||||
<Reference Include="System.Windows.Forms" />
|
<Reference Include="System.Windows.Forms" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
|
||||||
|
<PackageReference Include="System.Drawing.Common">
|
||||||
|
<Version>8.0.6</Version>
|
||||||
|
</PackageReference>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup Condition="'$(TargetFramework)' == 'net5'">
|
||||||
|
<PackageReference Include="System.Drawing.Common">
|
||||||
|
<Version>8.0.6</Version>
|
||||||
|
</PackageReference>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<DefineConstants Condition="'$(TargetFramework)'=='net40'">Net4</DefineConstants>
|
<DefineConstants Condition="'$(TargetFramework)'=='net40'">Net4</DefineConstants>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#if Net4
|
//#if Net4
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@ -83,4 +83,4 @@ namespace CPF.GDIPlus
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
//#endif
|
@ -1,4 +1,4 @@
|
|||||||
#if Net4
|
//#if Net4
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
@ -91,4 +91,4 @@ namespace CPF.GDIPlus
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
//#endif
|
@ -1,4 +1,4 @@
|
|||||||
#if Net4
|
//#if Net4
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@ -166,4 +166,4 @@ namespace CPF.GDIPlus
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
//#endif
|
@ -1,4 +1,4 @@
|
|||||||
#if Net4
|
//#if Net4
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@ -802,4 +802,4 @@ namespace CPF.GDIPlus
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
//#endif
|
@ -1,4 +1,4 @@
|
|||||||
#if Net4
|
//#if Net4
|
||||||
using CPF.Platform;
|
using CPF.Platform;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@ -20,7 +20,8 @@ namespace CPF.GDIPlus
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// GDI+不支持GPU加速
|
/// GDI+不支持GPU加速
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override bool UseGPU { get => false; set => throw new NotSupportedException("GDI+不支持GPU加速"); }
|
private bool _useGPU = false;
|
||||||
|
public override bool UseGPU { get => _useGPU; set => _useGPU = false; }
|
||||||
|
|
||||||
public override IImageImpl ImageFromFile(string path)
|
public override IImageImpl ImageFromFile(string path)
|
||||||
{
|
{
|
||||||
@ -333,4 +334,4 @@ namespace CPF.GDIPlus
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
//#endif
|
@ -1,4 +1,4 @@
|
|||||||
#if Net4
|
//#if Net4
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
@ -255,4 +255,4 @@ namespace CPF.GDIPlus
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
//#endif
|
@ -1,4 +1,4 @@
|
|||||||
#if Net4
|
//#if Net4
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing.Drawing2D;
|
using System.Drawing.Drawing2D;
|
||||||
@ -304,4 +304,4 @@ namespace CPF.GDIPlus
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
//#endif
|
@ -1,4 +1,4 @@
|
|||||||
#if Net4
|
//#if Net4
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@ -70,4 +70,4 @@ namespace CPF.GDIPlus
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
//#endif
|
Loading…
Reference in New Issue
Block a user