I think, we should use staticImage,and set an colour picture as its image;
when click the staticImage, we can getMousePostion(x,y);
As the picture's size is the same to the staticImage's size,so we can treat (x,y) as the picture's coordinate.
The problem is how can we get the colourValue at the point(x,y) in an picture?
Or anyone has a better solution?
[solved]How to realize color palette ?
Moderators: CEGUI MVP, CEGUI Team
[solved]How to realize color palette ?
Last edited by spracle on Tue Dec 28, 2010 09:32, edited 1 time in total.
Re: How to realize color palette ?
Yeah you can't quite do that, I already asked for it some time ago and IIRC nothing changed regarding that. The problem is that textures are held in GPU memory, not RAM. You would have to read back the texture buffer and that's terribly expensive. The other solution is to go for a shadow buffered texture. Either way CEGUI has no way to know which textures you are going to need this on. I actually went for a manual custom texture solution implemented with a shadowed Ogre::Texture.
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: How to realize color palette ?
This is achievable with some renderers in CEGUI 0.7.2 or better, and basically involves the technique to which Kulik refers (so in actual fact, if you can do it more directly, then you should probably prefer that route). Anyway, the technique involves rendering the widget to a texture (usually via the AutoRenderingSurface surface property), dumping the content to a buffer and sampling the buffer. The technique is described more fully here: http://www.cegui.org.uk/wiki/index.php/ ... EGUI_0.7.x where I discuss using the technique for non-rectangular hit-testing of windows.
HTH
CE.
HTH
CE.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Re: How to realize color palette ?
Out for several days..
Thanks,CE and Kulik.You guys are really helpful~
I decided to use secondary buffer in system RAM that contains a copy of the rendered texture,and performance may well not be a big problem.
one more question: why "Direct3D9Texture::saveToMemory" is Unimplemented?
Thanks,CE and Kulik.You guys are really helpful~
I decided to use secondary buffer in system RAM that contains a copy of the rendered texture,and performance may well not be a big problem.
one more question: why "Direct3D9Texture::saveToMemory" is Unimplemented?
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: How to realize color palette ?
spracle wrote:one more question: why "Direct3D9Texture::saveToMemory" is Unimplemented?
I think mainly because I never got around to implementing it yet. I will see if I can look into getting that done.
CE.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Re: How to realize color palette ?
CrazyEddie wrote:The technique is described more fully here: http://www.cegui.org.uk/wiki/index.php/ ... EGUI_0.7.x where I discuss using the technique for non-rectangular hit-testing of windows.
Got it in this way
Return to “Modifications / Integrations / Customisations”
Who is online
Users browsing this forum: No registered users and 11 guests