internal void RefreshUI()
        {
            currentCtx = proj.GetCurrentGfxContext();
            pnlPreviewImage.Refresh();

            // Update the region editing controls
            if (pnlPreviewImage.Controls.Count != proj.data.lTextRegions.Count)
            {
                DetachRegionControls();
                AttachRegionControls();
                LayoutRegionControls();
            }
            else
            {
                LayoutRegionControls();
            }
        }