-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The built-in KeyImage.Black does not always work #58
Comments
Can you post a code snippet to reproduce that behavior? |
Again, I don't have short code, but you may reproduce it in my project.
public override void UpdateVisuals(List<KeyboardElementVisuals> buttons, List<KeyboardElementVisuals> encoders)
{
if (deck == null)
return;
if (sleep)
{
deck.SetBrightness(brightness);
sleep = false;
}
// Prepare images to display
for (int i = 0; i < buttons.Count; i++)
{
RawImage? image = buttons[i].CustomCache as RawImage;
if (image != null)
deck.SetKeyBitmap(i, KeyBitmap.Create.FromBgra32Array(image.Width, image.Height, image.Argb));
else
deck.SetKeyBitmap(i, KeyBitmap.Black);
}
} The last line sets the image of a button to black if there is no image set by the user.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Occasionally, when button image is replaced with
KeyImage.Black
, it does not get replaced at all, leaving images from previous screen. This happens when all buttons are replaced in sequence (e.g. when switching the whole screen to a different one).Workaround: create a black (e.g.) 72x72 image manually and pass it instead of
KeyImage.Black
.The text was updated successfully, but these errors were encountered: