Corretta gestione colori dei property sheet
git-svn-id: svn://10.65.10.50/branches/R_10_00@22690 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
0dd99f6198
commit
f2abda8508
@ -2242,12 +2242,35 @@ void xvt_image_transfer(XVT_IMAGE dstimage, XVT_IMAGE srcimage, RCT *dstrctp, RC
|
||||
{
|
||||
const wxRect rctDst = RCT2Rect(dstrctp);
|
||||
const wxRect rctSrc = RCT2Rect(srcrctp);
|
||||
wxMemoryDC dc;
|
||||
wxBitmap bmp(*dst);
|
||||
dc.SelectObject(bmp);
|
||||
DrawImageOnDC(dc, src, rctDst, rctSrc);
|
||||
dst->Image() = bmp.ConvertToImage();
|
||||
dc.SelectObject(wxNullBitmap);
|
||||
|
||||
const wxRect rctDstI(0, 0, dst->GetWidth(), dst->GetHeight());
|
||||
const wxRect rctSrcI(0, 0, src->GetWidth(), src->GetHeight());
|
||||
|
||||
if (rctDst.GetSize() == rctSrc.GetSize() &&
|
||||
rctDstI.Contains(rctDst) && rctSrcI.Contains(rctSrc) &&
|
||||
src->HasAlpha() == dst->HasAlpha())
|
||||
{
|
||||
const int nPixelSize = src->HasAlpha() ? 4 : 3;
|
||||
const int nRowSize = nPixelSize * src->GetWidth();
|
||||
#ifndef NDEBUG
|
||||
#pragma omp parallel for
|
||||
#endif
|
||||
for (int y = 0; y < rctSrc.height; y++)
|
||||
{
|
||||
unsigned char* rgbSrc = src->Image().GetData() + (rctSrc.y+y)*nRowSize + rctSrc.x * nPixelSize;
|
||||
unsigned char* rgbDst = dst->Image().GetData() + (rctDst.y+y)*nRowSize + rctDst.x * nPixelSize;
|
||||
memcpy(rgbDst, rgbSrc, nPixelSize * rctSrc.width);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
wxMemoryDC dc;
|
||||
wxBitmap bmp(*dst);
|
||||
dc.SelectObject(bmp);
|
||||
DrawImageOnDC(dc, src, rctDst, rctSrc);
|
||||
dst->Image() = bmp.ConvertToImage();
|
||||
dc.SelectObject(wxNullBitmap);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2263,9 +2286,10 @@ BOOLEAN xvt_image_filter(XVT_IMAGE image, IMAGE_FILTER filter, void* param)
|
||||
if (ok)
|
||||
{
|
||||
const int nPixelSize = img->HasAlpha() ? 4 : 3;
|
||||
const int nRowSize = nPixelSize * img->GetWidth();
|
||||
for (short y = 0; y < h; y++)
|
||||
{
|
||||
unsigned char* rgb = img->Image().GetData() + nPixelSize*y;
|
||||
unsigned char* rgb = img->Image().GetData() + nRowSize*y;
|
||||
for (short x = 0; x < w; x++, rgb += nPixelSize)
|
||||
filter(x, y, rgb, param);
|
||||
}
|
||||
@ -2673,7 +2697,12 @@ XVT_IMAGE xvt_res_get_image(int rid)
|
||||
{
|
||||
const wxString strFileName = xvtart_GetResourceName("Image", rid);
|
||||
const bool ok = !strFileName.IsEmpty();
|
||||
XVT_ASSERT(ok);
|
||||
if (!ok)
|
||||
{
|
||||
wxString msg;
|
||||
msg << "Can't find image code " << rid << " in resource.ini";
|
||||
xvt_dm_post_note(msg);
|
||||
}
|
||||
return ok ? xvt_image_read(strFileName) : NULL;
|
||||
}
|
||||
|
||||
|
1114
xvaga/xvt.h
1114
xvaga/xvt.h
File diff suppressed because it is too large
Load Diff
@ -3297,9 +3297,15 @@ WIN_TYPE xvt_vobj_get_type(WINDOW win)
|
||||
if (ctl != NULL)
|
||||
{
|
||||
if (ctl->IsKindOf(CLASSINFO(wxTreeCtrl))) return WC_TREE;
|
||||
if (ctl->IsKindOf(CLASSINFO(wxPropertyGrid))) return WC_PROPGRID;
|
||||
if (ctl->IsKindOf(CLASSINFO(wxTreeListCtrl))) return WC_TREELIST;
|
||||
if (ctl->IsKindOf(CLASSINFO(wxPropertyGrid))) return WC_PROPGRID; // Siamo fiduciosi, ma ...
|
||||
}
|
||||
|
||||
// ... non deriva da wxControl :-)
|
||||
const wxPropertyGrid* pg = wxDynamicCast((wxObject*)win, wxPropertyGrid);
|
||||
if (pg != NULL)
|
||||
return WC_PROPGRID;
|
||||
|
||||
return WO_TE; // Unknown custom control
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user