Beispiel #1
0
        /// <summary>
        /// Load Image callback. This is called as the image is decompressed
        /// </summary>
        void codecs_LoadImage(object sender, CodecsLoadImageEventArgs e)
        {
            IntPtr lineBuffer = e.Buffer.Data;

            for (int i = 0; i < e.Lines; i++)
            {
                if (bCancel)
                {
                    e.Cancel = true;
                    return;
                }

                try
                {
                    RasterCodecs _codecs = (RasterCodecs)sender;
                    _codecs.Compress(lineBuffer);
                    lineBuffer = new IntPtr(lineBuffer.ToInt64() + bytesPerLine);
                    UpdateStatus(e.Row, e.TotalPercent);
                }
                catch (Exception ex)
                {
                    Messager.ShowError(this, ex.Message);
                    e.Cancel = true;
                    return;
                }

                Application.DoEvents();
            }
        }