gpt4 book ai didi

microsoft-band - 在 Microsoft Band 上显示图像

转载 作者:行者123 更新时间:2023-12-04 15:10:30 31 4
gpt4 key购买 nike

我想创建一个类似于乐队附带的星巴克应用程序的应用程序。我想显示条形码。我可以在云端或本地设备上将条形码生成为 JPG 图像,但我需要能够在乐队的屏幕上显示它们。到目前为止,我还没有找到使用 Band Client 在应用程序内显示图像的方法。

乐队客户有以下经理:

  • 通知管理器
  • 个性化管理器
  • 瓷砖经理
  • 传感器管理器

  • 我能想到的最接近的是通知管理器可以做到这一点,但唯一的方法是:
  • SendMessageAsync
  • ShowDialogAsync
  • VibrateAsync

  • 没有一个能胜任。有任何想法吗?现在我认为从 UI 的角度来看,SDK 可以做的事情相当有限。

    最佳答案

    今天更新的 SDK 现在支持条形码(还有一些更改)。 SDK 也出预览 woho!

    新的:

  • 丰富的内容磁贴 - 条形码和图标
  • 列表项
  • 我们可以有按钮! (不敢相信我对按钮如此兴奋)
  • 我们可以监听 tile 和按钮事件
  • 访问新数据-卡路里
  • Windows 手机后台支持
  • iOS 远程或本地通知

  • 这是来自上传的新示例应用程序的一些条形码代码。
            using (IBandClient bandClient = await BandClientManager.Instance.ConnectAsync(pairedBands[0]))
    {
    var myCardTextBlock = new TextBlock()
    {
    Color = Colors.Blue.ToBandColor(),
    ElementId = 1,
    Rect = new PageRect(0, 0, 200, 25)
    };
    var barcode = new Barcode(BarcodeType.Code39)
    {
    ElementId = 2,
    Rect = new PageRect(0, 0, 250, 50)
    };
    TextBlock digitsTextBlock = new TextBlock()
    {
    ElementId = 3,
    Rect = new PageRect(0, 0, 200, 25)
    };
    FlowPanel panel = new FlowPanel(myCardTextBlock, barcode, digitsTextBlock)
    {
    Orientation = FlowPanelOrientation.Vertical,
    Rect = new PageRect(0, 0, 250, 100)
    };


    Guid myTileId = new Guid("D781F673-6D05-4D69-BCFF-EA7E706C3418");
    BandTile myTile = new BandTile(myTileId)
    {
    Name = "My Tile",
    TileIcon = await LoadIcon("ms-appx:///Assets/SampleTileIconLarge.png"),
    SmallIcon = await LoadIcon("ms-appx:///Assets/SampleTileIconSmall.png")
    };
    myTile.PageLayouts.Add(new PageLayout(panel));


    await bandClient.TileManager.AddTileAsync(myTile);

    PageData page = new PageData(
    Guid.NewGuid(),
    0,
    new TextBlockData(myCardTextBlock.ElementId.Value, "MY CARD"),
    new BarcodeData(barcode.BarcodeType, barcode.ElementId.Value, "123456789"),
    new TextBlockData(digitsTextBlock.ElementId.Value, "123456789"));

    await bandClient.TileManager.SetPagesAsync(myTile.TileId, page);

    this.viewModel.StatusMessage = "Done. Check the Tile on your Band (it's the last Tile).";
    }

    关于microsoft-band - 在 Microsoft Band 上显示图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28835558/

    31 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com