|
|
MDX9 C#
主Surface m_surfacePrimary设置 Complex=true Flip=true,BackBufferCount=1
m_surfaceSecondary = m_surfacePrimary.GetAttachedSurface(desc.SurfaceCaps);
然后创建一个精灵suface m_bitmapSurface,
m_surfaceDesc = new SurfaceDescription();
m_surfaceDesc.SurfaceCaps.OffScreenPlain = true;
m_surfaceDesc.Width = m_nBitmapWidth;
m_surfaceDesc.Height = m_nBitmapHeight;
this.m_bitmapSurface = new Surface(m_sourceBitmap, m_surfaceDesc, m_targetDevice);
ColorKey tempKey = new ColorKey();
tempKey.ColorSpaceLowValue = colorTransparent;
tempKey.ColorSpaceHighValue = colorTransparent;
m_bitmapSurface.SetColorKey(ColorKeyFlags.SourceDraw, tempKey);
绘制的时候将 m_bitmapSurface图像绘制到m_surfaceSecondary
m_surfaceSecondary .DrawFast(ptTargetTopLeft.X,
ptTargetTopLeft.Y,
m_bitmapSurface,
rectSrc,
DrawFastFlags.SourceColorKey | DrawFastFlags.Wait);
精灵的背景颜色还在,哪位能帮忙解决一下 |
|