Exemple #1
0
        /// <summary>
        /// Redraws the images
        /// </summary>

        /*protected void Redraw()
         * {
         * Log.Info("dvb-teletext redraw()");
         * try
         * {
         *  // First update the foreground image. Step 1 make it invisible
         *  _updatingForegroundImage = true;
         *  imgTeletextForeground.IsVisible = false;
         *  // Clear the old image
         *  Image img = (Image) bmpTeletextPage.Clone();
         *  imgTeletextForeground.FileName = "";
         *  GUITextureManager.ReleaseTexture("[teletextpage]");
         *  // Set the new image and make the image visible again
         *  imgTeletextForeground.MemoryImage = img;
         *  imgTeletextForeground.FileName = "[teletextpage]";
         *  imgTeletextForeground.Centered = false;
         *  imgTeletextForeground.KeepAspectRatio = false;
         *  imgTeletextForeground.IsVisible = true;
         *  _updatingForegroundImage = false;
         *  // Update the background image now. Therefor make image invisible
         *  _updatingBackgroundImage = true;
         *  imgTeletextBackground.IsVisible = false;
         *  // Clear the old image
         *  Image img2 = (Image) bmpTeletextPage.Clone();
         *  imgTeletextBackground.FileName = "";
         *  GUITextureManager.ReleaseTexture("[teletextpage2]");
         *  // Set the new image and make the image visible again
         *  imgTeletextBackground.MemoryImage = img2;
         *  imgTeletextBackground.FileName = "[teletextpage2]";
         *  imgTeletextBackground.Centered = false;
         *  imgTeletextBackground.KeepAspectRatio = false;
         *  imgTeletextBackground.IsVisible = true;
         *  _updatingBackgroundImage = false;
         * }
         * catch (Exception ex)
         * {
         *  Log.Error(ex);
         * }
         * }*/
        protected void Redraw()
        {
            Bitmap bitmap;

            if (_redrawForeground)
            {
                imgTeletextForeground.IsVisible = false;
                if (!imgTeletextForeground.LockMemoryImageTexture(out bitmap))
                {
                    return;
                }
                _renderer.RenderPage(ref bitmap, receivedPage, receivedPageNumber, receivedSubPageNumber, _waiting);
                imgTeletextForeground.UnLockMemoryImageTexture();
                imgTeletextForeground.IsVisible = true;
            }
            else
            {
                imgTeletextBackground.IsVisible = false;
                if (!imgTeletextBackground.LockMemoryImageTexture(out bitmap))
                {
                    return;
                }
                _renderer.RenderPage(ref bitmap, receivedPage, receivedPageNumber, receivedSubPageNumber, _waiting);
                imgTeletextBackground.UnLockMemoryImageTexture();
                imgTeletextBackground.IsVisible = true;
            }
            _redrawForeground = !_redrawForeground;
        }