Corretta gestione palette con le immagini
git-svn-id: svn://10.65.10.50/trunk@3375 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
03d5b82451
commit
edd6008924
@ -449,8 +449,18 @@ void TImage::set_palette(
|
|||||||
WINDOW w) const // @parm Finestra a cui settare la palette
|
WINDOW w) const // @parm Finestra a cui settare la palette
|
||||||
{
|
{
|
||||||
XVT_PALETTE wp = xvt_vobj_get_palet(w);
|
XVT_PALETTE wp = xvt_vobj_get_palet(w);
|
||||||
if (wp != NULL && xvt_palet_get_type(wp) == XVT_PALETTE_USER)
|
if (wp != NULL)
|
||||||
xvt_palet_add_colors_from_image(wp, _image);
|
{
|
||||||
|
XVT_PALETTE p = xvt_palet_create(XVT_PALETTE_USER, NULL);
|
||||||
|
const int ncolors = xvt_palet_get_ncolors(wp);
|
||||||
|
COLOR* color = new COLOR[ncolors];
|
||||||
|
xvt_palet_get_colors(wp, color, ncolors);
|
||||||
|
xvt_palet_add_colors(p, color, ncolors);
|
||||||
|
delete color;
|
||||||
|
xvt_palet_add_colors_from_image(p, _image);
|
||||||
|
xvt_vobj_set_palet(w, p);
|
||||||
|
xvt_palet_destroy(wp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Certified 100%
|
// Certified 100%
|
||||||
|
Loading…
x
Reference in New Issue
Block a user