# Image loading in Gtk

**URL:** <https://discourse.julialang.org/t/image-loading-in-gtk/47977>\
**Category:** General Usage\
**Created:** [October 8, 2020, 9:20am UTC](https://discourse.julialang.org/t/image-loading-in-gtk/47977 "2020-10-08T09:20:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![libensvivit](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/libensvivit/32/19006_2.png) [@libensvivit](https://discourse.julialang.org/u/libensvivit)\
**Post date:** [October 8, 2020, 9:20am UTC](https://discourse.julialang.org/t/image-loading-in-gtk/47977/1 "2020-10-08T09:20:18Z")

</div>

I’m trying load an image in Gtk, so far I found `GdkPixbuf()` function in the source, that accepts filename as argument but I couldn’t make it work. I think image loading is not supported yet.

`using Gtk`  
`win = GtkWindow("Loading Image..", 400, 200)`  
`x = GdkPixbuf(filename="b1.jpg")`  
`push!(win, x)`  
`showall(win)`

Is there any other way to load an image in Gtk?

EDIT: I just found [this](https://github.com/JuliaGraphics/Gtk.jl/issues/249). But it doesn’t work for me, @GtkImage is not defined.

---

<div class="post-metadata">

**Author:** ![Iulian.Cioarca](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iulian.cioarca/32/30166_2.png) [@Iulian.Cioarca](https://discourse.julialang.org/u/Iulian.Cioarca)\
**Post date:** [October 8, 2020, 9:44am UTC](https://discourse.julialang.org/t/image-loading-in-gtk/47977/2 "2020-10-08T09:44:52Z")

</div>

Here’s a snippet from a GUI I used around 1 year ago:

```julia
using Gtk
using FileIO
using ImageView
using Gtk.ShortNames, GtkReactive

win = GtkWindow("GUI", 600, 600);
c = canvas(UserUnit,400,400);
img = load(files.file_path[files.crt_file])
imshow(c,ImageView.Signal(img))

```

Sorry it’s not complete working examples, maybe later I’ll find some time to test and post.

I hope it helps.
