digitalmars.D.learn - image embeded as ubtye
- okibi (8/8) Jul 30 2007 Hello!
- Frank Benoit (6/11) Jul 30 2007 If this is something like swt, you can probably use a ByteArrayStream or
- Stewart Gordon (4/6) Jul 30 2007 If the image is small enough to store in a single byte, you're lucky.
Hello! I've got an image converted to a d source file that contains the image as a ubyte variable. What I'm wanting to know is how do I apply this as the image for a button in gtkD? I was calling the external file, like such: Image newImg = new Image("images\\new.png"); Button newBtn = new Button(); newBtn.setImage(newImg); How can I set the ubyte as the image? Thanks!
Jul 30 2007
Image newImg = new Image("images\\new.png"); Button newBtn = new Button(); newBtn.setImage(newImg); How can I set the ubyte as the image?If this is something like swt, you can probably use a ByteArrayStream or something like this. BTW, since the import statement of D can include external files into char[] variables at compile time, it is no more needed to generate source files for that. (you need to set the -J compiler option) ubyte[] imagesdata = cast(ubyte[]) import( "myfile.png" );
Jul 30 2007
"okibi" <okibi ratedo.com> wrote in message news:f8kit9$7o9$1 digitalmars.com...I've got an image converted to a d source file that contains the image as a ubyte variable.If the image is small enough to store in a single byte, you're lucky. Stewart.
Jul 30 2007