<ReleaseVersion>0.8.0</ReleaseVersion>
<AssemblyVersion>$(CrowVersion)</AssemblyVersion>
-
<Title>C# Rapid Open Widget Toolkit</Title>
<Description>C.R.O.W. is a widget toolkit and rendering engine developed in C# with templates, styles, compositing, and bindings.</Description>
<License>MIT</License>
<Authors>Jean-Philippe Bruyère</Authors>
<RepositoryUrl>https://github.com/jpbruyere/Crow</RepositoryUrl>
-
<PackageVersion>$(CrowPackageVersion)</PackageVersion>
<PackageTags>GUI Widget toolkit Interface C# .Net Mono</PackageTags>
-
<PackageRequireLicenseAcceptance>False</PackageRequireLicenseAcceptance>
<PackageProjectUrl>https://github.com/jpbruyere/Crow/wiki</PackageProjectUrl>
<PackageLicense>https://opensource.org/licenses/MIT</PackageLicense>
This release should solve most of ms dotnet exception, the win32 backend is
still untested. Next beta will have a glfw backend.
</PackageReleaseNotes>
-
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
-
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);1591;1587;1570;1572;1573;1574</NoWarn>
-
+ <DefineConstants>DESIGN_MODE</DefineConstants>
<DefineConstants>DESIGN_MODE</DefineConstants>
<EnableDefaultItems>false</EnableDefaultItems>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<PackageReference Include="System.Reflection.Emit.Lightweight" Version="4.6.0" />
<!--<PackageReference Include="glfw-sharp" Version="0.2.0" />-->
</ItemGroup>
+ <PropertyGroup Condition=" '$(CrowStbSharp)' == 'true'">
+ <DefineConstants>$(DefineConstants);STB_SHARP</DefineConstants>
+ </PropertyGroup>
+ <ItemGroup Condition=" '$(CrowStbSharp)' == 'true'">
+ <PackageReference Include="StbImageSharp" Version="2.22.4" />
+ </ItemGroup>
<ItemGroup>
<Content Include="$(SolutionDir)Images/crow.png" Pack="true" PackagePath="" />
<Compile Include="src\**\*.cs" Exclude="src\Mono.Cairo\NativeMethods-internal.cs;src\backends\win32\User32\Structs\RawInputDevice.cs" />
-//
-// BmpPicture.cs
+// Copyright (c) 2013-2020 Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
//
-// Author:
-// Jean-Philippe Bruyère <jp.bruyere@hotmail.com>
-//
-// Copyright (c) 2013-2017 Jean-Philippe Bruyère
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
+// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
using System;
using System.IO;
return;
}
using (Stream stream = Interface.StaticGetStreamFromPath (Path)) {
+#if STB_SHARP
+ StbImageSharp.ImageResult stbi = StbImageSharp.ImageResult.FromStream (stream, StbImageSharp.ColorComponents.RedGreenBlueAlpha);
+ image = new byte [stbi.Data.Length];
+ //rgba to argb for cairo.
+ for (int i = 0; i < stbi.Data.Length; i += 4) {
+ image [i] = stbi.Data[i + 2];
+ image [i + 1] = stbi.Data [i + 1];
+ image [i + 2] = stbi.Data [i];
+ image [i + 3] = stbi.Data [i + 3];
+ }
+ Dimensions = new Size (stbi.Width, stbi.Height);
+#else
using (StbImage stbi = new StbImage (stream)) {
image = new byte [stbi.Size];
//rgba to argb for cairo.
}
Dimensions = new Size (stbi.Width, stbi.Height);
}
+#endif
//loadBitmap (new System.Drawing.Bitmap (stream));
}
bitmap.UnlockBits (data);
}*/
- #region implemented abstract members of Fill
+#region implemented abstract members of Fill
public override void SetAsSource (Context ctx, Rectangle bounds = default(Rectangle))
{
ctx.SetSource (tmp);
}
}
- #endregion
+#endregion
/// <summary>
/// paint the image in the rectangle given in arguments according