bool IGFrame::Update() { if (!UpdateSize (head.biWidth, head.biHeight)) return false; // update selection rect RECT rcSel = {0, 0, -1, -1}; CxImage *pLayer = GetWorkingLayer(); if (pLayer->SelectionIsValid()) pLayer->SelectionGetBox (rcSel); if (rcSel.right != -1 && rcSel.bottom != -1){ long nOffsetX, nOffsetY; pLayer->GetOffset (&nOffsetX, &nOffsetY); rcSel.left += nOffsetX; rcSel.right += nOffsetX; rcSel.top -= nOffsetY; rcSel.bottom -= nOffsetY; } wchar_t twLeft [32], twRight [32], twTop [32], twBottom [32]; ::_itow (rcSel.left, twLeft, 10); ::_itow (rcSel.right, twRight, 10); ::_itow (rcSel.top, twTop, 10); ::_itow (rcSel.bottom, twBottom, 10); wstring wsSelRect (twLeft); wsSelRect += L"#"; wsSelRect+= twRight; wsSelRect += L"#"; wsSelRect+= twTop; wsSelRect += L"#"; wsSelRect+= twBottom; SetProperty (IGFRAMEPROPERTY_SELECTIONRECT, wsSelRect); // update current history step id SetProperty (IGFRAMEPROPERTY_HISTORYSTEP, GetCurrentStepId()); return true; }