/// <summary>
        /// Send bitmap data in clearCodec encoding method.
        /// </summary>
        /// <param name="sId">This is used to indicate the target surface id.</param>
        /// <param name="pixFormat">This is used to indicate the pixel format to fill target surface.</param>
        /// <param name="ccFlag">This is used to indicate the clearcodec stream flags.</param>
        /// <param name="graphIdx">This is used to indicate the index of graph to be put in client graph cache.</param>
        /// <param name="bmRect">The rectangle of whole Image, which will be sent in clearcodec, relative to the surface </param>
        /// <param name="residualImage"> The residual layer image to be sent </param>
        /// <param name="bands"> The dictionary of band layer image and position </param>
        /// <param name="subcodecs"> The dictionary of subcodec layer image, subcodecID and position </param>
        /// <returns> Frame Id </returns>
        public uint SendImageWithClearCodec(ushort sId, PixelFormat pixFormat, byte ccFlag, ushort graphIdx, RDPGFX_RECT16 bmRect, Image residualBmp, 
            Dictionary<RDPGFX_POINT16, Bitmap> bands, Dictionary<RDPGFX_POINT16, BMP_INFO> subcodecs)
        {
            uint fid = MakeStartFramePdu();

            ClearCodec_BitmapStream ccStream = new ClearCodec_BitmapStream(ccFlag, graphIdx);
            if ((ushort)currentTestType >= 500 && (ushort)currentTestType <= 599)
            {
                // Clearcodec negative test
                ccStream.SetTestType(currentTestType);
            }

            ccStream.LoadResidualBitmap((Bitmap)residualBmp);
            if(bands != null)
            {
                foreach (KeyValuePair<RDPGFX_POINT16, Bitmap> band in bands)
                {
                    ccStream.LoadBandBitmap(band.Value, band.Key);
                }
            }
            if (subcodecs != null)
            {
                foreach (KeyValuePair<RDPGFX_POINT16, BMP_INFO> scBmp in subcodecs)
                {
                    ccStream.LoadSubcodecBitmap(scBmp.Value.bmp, scBmp.Key, scBmp.Value.scID);
                }
            }
            ccStream.seqNumber = egfxServer.Get_ClearCodecBitmapStream_SeqNum();
            MakeWireToSurfacePdu1(sId, CodecType.RDPGFX_CODECID_CLEARCODEC, pixFormat, bmRect, ccStream.Encode());
            MakeEndFramePdu(fid);

            PackAndSendServerPdu();

            if (this.bcgrAdapter.SimulatedScreen != null)
            {
                this.bcgrAdapter.SimulatedScreen.RenderClearCodecImage(sId, pixFormat, ccFlag, graphIdx, bmRect, residualBmp, bands, subcodecs);
            }

            return fid;
        }