forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

color = image:pixel(x,y) to array ?

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development
View previous topic :: View next topic  
Author Message
Julu Julu



Joined: 01 Nov 2005
Posts: 9
Location: Germany

PostPosted: Thu Dec 01, 2005 4:13 pm    Post subject: color = image:pixel(x,y) to array ? Reply with quote

Hi,

i have an Array.

Code:

a = {}
    for i=0,10 do
         color = image:pixel(x,y)
         newColor= color:colors()
         a[i] = newColor ???
    end


How can i copy getColor to the array?
Back to top
View user's profile Send private message
alexis



Joined: 14 Nov 2005
Posts: 11
Location: between neptune and mars

PostPosted: Fri Dec 02, 2005 6:55 am    Post subject: Reply with quote

I'm not sure to understand clearely the point but probabely somethink like

Code:

    c=image:pixel(x,y):colors()
    a[i]=Color:new(c.r, c.g, c.b)


could help you to construct a copy of the Color instance you get with pixel method.

Regards.
Alexis.
_________________
Ho no ... !! I make the same bug again !!!
Back to top
View user's profile Send private message Send e-mail
alexis



Joined: 14 Nov 2005
Posts: 11
Location: between neptune and mars

PostPosted: Fri Dec 02, 2005 7:04 am    Post subject: Reply with quote

Or do you mean

Code:

    c=image:pixel(x,y):colors()
    a[1]=c.r
    a[2]=c.g
    a[3]=c.b


????
_________________
Ho no ... !! I make the same bug again !!!
Back to top
View user's profile Send private message Send e-mail
Julu Julu



Joined: 01 Nov 2005
Posts: 9
Location: Germany

PostPosted: Sat Dec 03, 2005 5:45 am    Post subject: Reply with quote

Thanks alexis.
The first Code is exactly which I searched
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group