fix(ci): load cup logo from embedded resource instead of maui asset
Replace MAUI asset pipeline logo loading with embedded resource stream to fix logo not appearing in consuming NuGet projects. Add CustomLogoSource property to Button and Widget controls for custom branding. Update logo to higher resolution PNG. Bump version to 1.1.2.
This commit is contained in:
@@ -1,22 +1,21 @@
|
||||
using System.Reflection;
|
||||
|
||||
namespace BuyMeCofee.Maui.Helpers;
|
||||
|
||||
internal static class BmcBrandAssets
|
||||
{
|
||||
// MAUI converts bmc_logo.svg → bmc_logo.png at build time with proper DPI scaling
|
||||
private const string LogoFileName = "bmc_logo.png";
|
||||
|
||||
// Fallback: embedded PNG for QR code overlay (SkiaSharp needs a raw stream)
|
||||
// Embedded PNG resource name — travels with the NuGet package assembly
|
||||
private const string EmbeddedLogoName = "BuyMeCofee.Maui.Resources.Images.bmc_logo.png";
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cup logo as an ImageSource for MAUI Image controls.
|
||||
/// Uses the MAUI asset pipeline (SVG → crisp multi-DPI PNG).
|
||||
/// Loads from embedded PNG resource so it works in consuming NuGet projects.
|
||||
/// </summary>
|
||||
internal static ImageSource GetCupLogo()
|
||||
{
|
||||
return ImageSource.FromFile(LogoFileName);
|
||||
return ImageSource.FromStream(() =>
|
||||
{
|
||||
var assembly = typeof(BmcBrandAssets).Assembly;
|
||||
return assembly.GetManifestResourceStream(EmbeddedLogoName)!;
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user