result = aBlender->Blend(aSX,aSY,aWidth,aHeight,srcdc,dstdc,0, 0,aBlendAmount,aBuff);
result = aBlender->Blend(aSX,aSY,aWidth,aHeight,srcdc,dstdc,0, 0,aBlendAmount);
Compositetest(nsIBlender *aBlender,nsIImage *aImage,                  PRInt32 aSX, PRInt32 aSY, PRInt32 aWidth,PRInt32 aHeight,                  PRInt32 aDX, PRInt32 aDY,                  float aBlendAmount,PRBool aBuff){nsresult            result = NS_ERROR_FAILURE;PRUint8             *thebytes,*curbyte,*srcbytes,*cursourcebytes;PRUint16            *cur16;PRInt32             w,h,ls,x,y,numbytes,sls;HDC                 srcdc,dstdc;HBITMAP             srcbits,tb1;BITMAP              srcinfo;LPBITMAPINFOHEADER  srcbinfo;nsIRenderingContext *drawCtx = gWindow->GetRenderingContext();  //srcdc = (HDC)aBlender->GetSrcDS();  //dstdc = (HDC)aBlender->GetDstDS();  //result = aBlender->Blend(aSX,aSY,aWidth,aHeight,dstdc,0, 0,aBlendAmount,aBuff);gSrcdc  result = aBlender->Blend(aSX,aSY,aWidth,aHeight,srcdc,dstdc,0, 0,aBlendAmount,aBuff);  if(result == NS_OK)    {    // 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);       // put the bitmap back into the image    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());  }  return(result);}