aBlender->RestoreImage(dstdc);
Restore(nsIBlender *aBlender,nsIImage *aImage){PRUint8             *thebytes,*curbyte,*srcbytes,*cursourcebytes;PRUint16            *cur16;PRInt32             w,h,ls,x,y,numbytes,sls;HDC                 dstdc;HBITMAP             srcbits,tb1;BITMAP              srcinfo;LPBITMAPINFOHEADER  srcbinfo;nsIRenderingContext *drawCtx = gWindow->GetRenderingContext();  //dstdc = (HDC)aBlender->GetDstDS();  aBlender->RestoreImage(dstdc);  // this takes the Destination DC and copies the information into aImage  tb1 = CreateCompatibleBitmap(dstdc,3,3);  srcbits = (HBITMAP)::SelectObject(dstdc, tb1);  numbytes = ::GetObject(srcbits,sizeof(BITMAP),&srcinfo);  // put into a DIB  BuildDIB(&srcbinfo,&srcbytes,srcinfo.bmWidth,srcinfo.bmHeight,srcinfo.bmBitsPixel);  numbytes = ::GetDIBits(dstdc,srcbits,0,srcinfo.bmHeight,srcbytes,(LPBITMAPINFO)srcbinfo,DIB_RGB_COLORS);    ::SelectObject(dstdc,srcbits);  DeleteObject(tb1);  // copy the information back into the source  thebytes = aImage->GetBits();  h = aImage->GetHeight();  w = aImage->GetWidth();  ls = aImage->GetLineStride();  sls = CalcBytesSpan(srcinfo.bmWidth,srcinfo.bmBitsPixel);  if(srcinfo.bmBitsPixel==24)    {    for(y=0;y<h;y++)      {      curbyte = thebytes + (y*ls);      cursourcebytes = srcbytes + (y*sls);      for(x=0;x<ls;x++)        {        *curbyte = *cursourcebytes;        curbyte++;        cursourcebytes++;        }      }    }    else      if(srcinfo.bmBitsPixel==16)     // 16 bit going into a 24 bit        {        for(y=0;y<h;y++)          {          curbyte = thebytes + (y*ls);          cur16 = (PRUint16*)(srcbytes + (y*sls));          for(x=0;x<w;x++)            {            *curbyte = BLUE16(*cur16);            curbyte++;            *curbyte = GREEN16(*cur16);            curbyte++;            *curbyte = RED16(*cur16);            curbyte++;            cur16++;            }          }        }  delete [] srcbytes;  delete srcbinfo;  //drawCtx->DrawImage(aImage, 0, 0, aImage->GetWidth(), aImage->GetHeight());}