Antwort: [Glade-users] Display JPEG images in a Glade based program.



--=_mixed 003FAC54C1256AA8_=
Content-Type: text/plain; charset="us-ascii"

Duarte Duque wrote:
I'am trying to write a simple program that display JPEG images.
I can do that writing all the code (in C), using GDK. But I want display 
it
in a GDK window from GLADE.
To read the images I use GDK:
GdkImlibImage *image;
image = gdk_imlib_load_image("car.jpg");

But my problem is how to put this image in a GTK window.

Hi Duarte,

I had a similar problem lately. I wanted to draw a raw image I got from
my vision libray onto a GtkImage widget. The way to do this is:
- draw raw image onto an offscreen buffer (a GtkPixmap)
- then draw buffer onto the GtkImage
See the inclosed part of code for more information

The only thing I can't tell you, is how you'll get the jpeg onto the 
GtkPixmap.

One strange this I have come across is that this sometimes hangs if the
draw onto the GtkImage happens at the same time as a redraw (eg. when the 
window
was covered and is expoed again). Has anyone an idea how to solve this?

cu.
Franz
------------------------------------------------------------------
Franz Parzefall
Vision Systems

Multitest elektronische Systeme GmbH & Co. KG
Aeussere Oberaustr. 4
83026 Rosenheim
Germany
Tel:   +49 (0)8031 406 473
Fax:   +49 (0)8031 406 420
Email: f parzefall multitest de
Web:   www.multitest.de
------------------------------------------------------------------



--=_mixed 003FAC54C1256AA8_=
Content-Type: application/octet-stream; name="ttt.c"
Content-Disposition: attachment; filename="ttt.c"
Content-Transfer-Encoding: base64

R3RrV2lkZ2V0ICAgICAgICppbWFnZV93aWRnZXQ7Ckdka0dDICAgICAgICAgICAqZ2MgPSBOVUxM
OwpHZGtQaXhtYXAgICAgICAgKmJ1ZmZlciA9IE5VTEw7CihndWNoYXIqKSAgICAgICBwX2ltZyAg
ICAgICAgICAgIC8vcG9pbnRlciB0byB0aGUgcmF3IGltYWdlCmxvbmcgICAgICAgICAgICB3aWR0
aDsgICAgICAgICAgIC8vd2lkdGggb2YgdGhlIGltYWdlCmxvbmcgICAgICAgICAgICBoZWlnaHQ7
ICAgICAgICAgIC8vaGVpZ2h0IG9mIHRoZSBpbWFnZQoKCi8vIGRyYXcgcmF3IGltYWdlIG9udG8g
YW4gb2Zmc2NyZWVuIGJ1ZmZlcgogICAgICBnZGtfZHJhd19ncmF5X2ltYWdlKGJ1ZmZlciwKCQkJ
ICBnYywKCQkJICAwLAoJCQkgIDAsCgkJCSAgd2lkdGgsCgkJCSAgaGVpZ2h0LAoJCQkgIEdES19S
R0JfRElUSEVSX05PTkUsCgkJCSAgcF9pbWcsCgkJCSAgd2lkdGgpOwoKLy9kcmF3IG9mZnNjcmVl
bmJ1ZmZlciBvbnRvIHRoZSBpbWFnZSB3aWRnZXQKICAgICAgZ2RrX2RyYXdfcGl4bWFwKGltYWdl
X3dpZGdldC0+d2luZG93LCAKCQkgICAgICBnYywKCQkgICAgICBidWZmZXIsIAoJCSAgICAgIDAs
CgkJICAgICAgMCwKCQkgICAgICBpbWFnZV93aWRnZXQtPmFsbG9jYXRpb24ueCwKCQkgICAgICBp
bWFnZV93aWRnZXQtPmFsbG9jYXRpb24ueSwKCQkgICAgICAtMSwgCgkJICAgICAgLTEpOwoK
--=_mixed 003FAC54C1256AA8_=--





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]