Thanks for your explanation, currently my code like this:
//------------------------------------------------------------------------
public void DrawTile(int x,int y,Tile pic)
{
int w=pic.Width;
int h=pic.Height;
Bitmap bm=pic.ImageData;
bool cut=false;
if(pic.Width>ScreenWidth-x)
{
w=ScreenWidth-x;
cut=true;
}
if(pic.Height>ScreenHeight-y)
{
h=ScreenHeight-y;
cut=true;
}
if(cut)
{
Rectangle srcRect=new Rectangle(0,0,w,h);
bm=pic.ImageData.Clone(srcRect,pic.ImageData.PixelFormat);//GDI+ Function
}
description.Clear();
description.SurfaceCaps.OffScreenPlain=true;
Surface surface=new Surface(bm,description,display);
back.DrawFast(x,y,surface,DrawFastFlags.Wait);
surface.Dispose();
}
//---------------------------------------------------------------------------
The mixed use of DirectDraw and GDI+ make the draw speed
very slow.
How to solve this problem?
Is there a similar problem in Direct3D?