gtkD load images

Mike Wey via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Aug 5 05:51:13 PDT 2017


On 03-08-17 21:56, Johnson Jones wrote:
> If I do something like
> 
> import gdkpixbuf.Pixbuf;
> Pixbuf.newFromResource("C:\\a.jpg");

There are two issues here, you need to properly escape the slash: 
"C:\\\\a.jpg".

And a.jpg is not a resource file, so you would use the Pixbuf constuctor 
to load an image file.

```
Pixbuf p = new Pixbuf(r"C:\\a.jpg");
```

-- 
Mike Wey


More information about the Digitalmars-d-learn mailing list