Limited
2
0
Files
logikonline a719eb7975
All checks were successful
Release / Verify Apple Build (push) Successful in 12s
Release / Build & Pack (push) Successful in 8h59m32s
Release / Publish (push) Successful in 15s
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.
2026-03-04 02:37:46 -05:00

36 lines
1.3 KiB
C#

namespace BuyMeCofee.Maui.Helpers;
internal static class BmcBrandAssets
{
// 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.
/// Loads from embedded PNG resource so it works in consuming NuGet projects.
/// </summary>
internal static ImageSource GetCupLogo()
{
return ImageSource.FromStream(() =>
{
var assembly = typeof(BmcBrandAssets).Assembly;
return assembly.GetManifestResourceStream(EmbeddedLogoName)!;
});
}
/// <summary>
/// Returns the cup logo as a raw stream for SkiaSharp rendering (QR code overlay).
/// Falls back to embedded PNG resource.
/// </summary>
internal static Stream? GetCupLogoStream()
{
// Try embedded resource first (for QR code SkiaSharp rendering)
var assembly = typeof(BmcBrandAssets).Assembly;
var stream = assembly.GetManifestResourceStream(EmbeddedLogoName);
if (stream != null) return stream;
// If embedded PNG was removed, return null (QR code will render without logo)
return null;
}
}