https://linen.dev logo
Join Discord
Powered by
# haxe-ui
  • b

    bright-gpu-74537

    08/29/2022, 7:38 AM
    presumably you already have code there that is doing it
  • c

    clever-yak-82528

    08/29/2022, 7:38 AM
    i do
  • b

    bright-gpu-74537

    08/29/2022, 7:38 AM
    i vaguely remember adding some util functions to hxwidgets for it
  • c

    clever-yak-82528

    08/29/2022, 7:39 AM
    Copy code
    haxe
    var image = new hx.widgets.Image(null, 200, 56, true);
    image.imageData.copyARGB(argbdata);
    return new hx.widgets.Bitmap(image);
  • b

    bright-gpu-74537

    08/29/2022, 7:39 AM
    ok, so there you go...
  • c

    clever-yak-82528

    08/29/2022, 7:39 AM
    this, however, is not portable
  • b

    bright-gpu-74537

    08/29/2022, 7:39 AM
    well, image display is pretty framework specific
  • b

    bright-gpu-74537

    08/29/2022, 7:39 AM
    esp from raw bytes
  • c

    clever-yak-82528

    08/29/2022, 7:40 AM
    i mean
  • c

    clever-yak-82528

    08/29/2022, 7:40 AM
    i feel like it's a pretty fundamental thing to do
  • b

    bright-gpu-74537

    08/29/2022, 7:40 AM
    i wouldnt say many people want to create images from raw data... pngs, bmps data... maybe... but i dont think its common to be like "i want to show ARGB data"
  • b

    bright-gpu-74537

    08/29/2022, 7:41 AM
    that said, its not impossible to create an abstraction for it, i just dont personally feel its high priority as, except for you, its never come up before
  • c

    clever-yak-82528

    08/29/2022, 7:41 AM
    ...huh
  • c

    clever-yak-82528

    08/29/2022, 7:41 AM
    i use it quite a lot
  • c

    clever-yak-82528

    08/29/2022, 7:42 AM
    i feel like it wouldnt be too hard to have an abstracted function that converts rgba -> native pixel format that can be imported into an image
  • b

    bright-gpu-74537

    08/29/2022, 7:42 AM
    i dont really know of another UI framework that lets you shunt raw pìxel data into a UI... i mean, you can if you jump though some hoops... even that copyARGB isnt simple in wxwidgets
  • c

    clever-yak-82528

    08/29/2022, 7:43 AM
    weird
  • b

    bright-gpu-74537

    08/29/2022, 7:43 AM
    do you?
  • c

    clever-yak-82528

    08/29/2022, 7:43 AM
    it seems like it would be a really obvious feature
  • c

    clever-yak-82528

    08/29/2022, 7:44 AM
    but, thinking back to it, when i did this kind of thing in python, i would have to use an image library to convert the image data, and then pass that to a compatibility layer, and then to the gui library
  • b

    bright-gpu-74537

    08/29/2022, 7:44 AM
    i think its the opposite of obvious to be honest... i mean, its very specific, why would anyone (in general) be working with raw ARGB data under "normal" circumstances?
  • b

    bright-gpu-74537

    08/29/2022, 7:44 AM
    exactly
  • c

    clever-yak-82528

    08/29/2022, 7:44 AM
    any kind of image modification
  • c

    clever-yak-82528

    08/29/2022, 7:44 AM
    viewing obscure formats
  • c

    clever-yak-82528

    08/29/2022, 7:44 AM
    creating viewers for obscure formats
  • c

    clever-yak-82528

    08/29/2022, 7:44 AM
    developing new formats
  • c

    clever-yak-82528

    08/29/2022, 7:44 AM
    implementing new formats
  • b

    bright-gpu-74537

    08/29/2022, 7:45 AM
    sure, but these arent "super obvious" usages is what im saying... and you can do it, its just not "the default" (as i wouldnt expect it to be in any UI framework)
  • c

    clever-yak-82528

    08/29/2022, 7:45 AM
    hm
  • b

    bright-gpu-74537

    08/29/2022, 7:46 AM
    i mean, i doubt it would be hard to add a
    ToolkitAssets.imageFromRaw(bytes, width, height, format, callback)
1...123112321233...1687Latest