image in gui

how do i put a image in a gui?
and can i use a image as a button?

the method :

Tice script- I used the same method for my image thumbnailer :slight_smile:

There will be a function added after the feature freeze that allows image drawing without loading into GL memory and drawing as a quad- but for now this is nice.


this line has a error
and i set the path to the image

I just re-test the script copied from its web address :
not from the web page, there is no error on the line you pointed .

what version is the script for?

Take a look at the pict :

it still doesnt work. it says

do you have any other image scripts that might work on my computer?

For tga only :

that script makes another file and if it does display an image how?

and this looks like what i am trying to do

i cant read whatever language it is written in

sorry for being annoying

That scrit reads an image with the “def read_tgafile(loc):”
function . Sorry, you have to work a little to make it works
correctly. :wink:

ps: the language of the other page is “french”.

Wow, only two users going at it! Cool!

Hey scabootssca, I suggest you try using my Gui_Creator or RipStings Gui creator. :wink:

i have and would prefer to know how to do it than use a program to

The way my GUI editor works is it takes pixel color samples and stores them in a huge list. If you create a quick gui with an image in it you can see the code it generates and you can copy it. The thing with this method is you need an external parser (like my GUI editor) to generate the pixel list.

ok i’ll try that

could you please post the code so i could enter the file path and it would generate a list to a file

kinda like

def GetImageList(Path, CodeTo):

please i used the code generated but now i need this
thank you

How about getting images on buttons and such… Is that possible?

Here is the code to do it. It doesn’t check to see if the file is an image or not, it just lists all files in a certain folder.

import sys, os
from stat import *

for f in os.listdir(path):
	pathname = os.path.join(path, f)
	mode = os.stat(pathname)[ST_MODE]
        if S_ISREG(mode):