问题描述
- delphi 的问题~~~~~~~~~~
-
我在CreateForm里面调用这个方法,就给报Access violation的错误。。求解救。
Form1->Images->Canvas->StretchDraw(TRect(0, 0, 480, 320), gBufs);这句在就报~~~void PaintAlls() { gBufs->SetSize(gMapData.bgImageDis->Width, gMapData.bgImageDis->Height); TCanvas* canvas = gBufs->Canvas; TRect rect( 0, 0, gBufs->Width, gBufs->Height ); canvas->Brush->Color = 0; canvas->FillRect(rect); canvas->Draw( gMapData.x, gMapData.y, gMapData.bgImageDis ); vector<MapObjects>::iterator itor = gMapData.objects.begin(); while (itor != gMapData.objects.end()) { itor->Draw(canvas, gMapData.x, gMapData.y); itor++; } // 框框 gMapData.smallK.Draw(canvas, FormMain->Image1->ClientWidth, FormMain->Image1->ClientHeight); Form1->Images->Canvas->StretchDraw(TRect(0, 0, 480, 320), gBufs); };
时间: 2024-09-27 17:09:16