把大图片分成四张小图片,定义了一个TBitmap指针数组,循环LoadFromFile,执行报错!

for(height=ImageHeight;height<=Image1->Height;height+=ImageHeight)
for(width=ImageWidth;width<=Image1->Width;width+=ImageWidth)
{
Application->ProcessMessages();
if(IdChange == true)
{
for(i;i>=0;i--)
delete pBitmap[i];
//lbTis->Caption = "";
return;
}
lbTis->Caption = "正在加载图片...";
String filename = DataModule5->adoqryPicture->FieldByName("name")->AsString;
String pathheader = "F:\";
String path = pathheader+ filename;
pBitmap[i] = new Graphics::TBitmap();
pBitmap[i]->LoadFromFile(path);

            SrcRect = Rect(0,0,pBitmap[i]->Width,pBitmap[i]->Height);
            DstRect = Rect(width-ImageWidth,height-ImageHeight,width,height);
            Image1->Canvas->CopyRect(DstRect,pBitmap[i]->Canvas,SrcRect);
            DataModule5->adoqryPicture->RecNo++;
            i++;
            //delete pBitmap;
        }

进入第二次循环时会报错“存储空间不足,无法执行该命令”

查看全部
sznray
sznray
2015/08/25 09:14
  • canvas
  • 图片
  • tbitmap
  • 点赞
  • 收藏
  • 回答
    私信

1个回复