这个大JPEG有20m大,可不能把它转为BItmap呀,内存会死的.with tjpegimage.create do
try
  loadfromfile('c:\a.jpg');
  for i:=0 to 24 do
  begin
    for j:=0 to 24 do
    begin
      {这里可怎么写?}
    end; 
  end;
finally
  free;
end;

解决方案 »

  1.   

    分割后用a001.jpg,a002.jpg...的文件名形式存于c:\a\下面
      

  2.   

    能不能说一说怎么调用?要化为BITMAP才用吗?
      

  3.   

    能不能说一说怎么调用?要化为BITMAP才用吗?
      

  4.   

    转了我也还不会用这个函数.用TCANVAS就会.还请指点.
      

  5.   

    要先转位图,算法很简单~~~以前帮人随手写过一个切分100*100为10*10的函数,参考一下,只需要注意一下DWORD对齐的问题BOOL Bmp_Incise(const char *filename)
    {
            BITMAPFILEHEADER bmpfileheader;
            BITMAPINFOHEADER bmpinfoheader;
            ifstream bmpfile;
            bmpfile.open(filename, ios::in|ios::binary);
            if(!bmpfile) {
                    return false;
            }
            else {
                    bmpfile.read((char *)&bmpfileheader, sizeof(bmpfileheader));
                    if(bmpfileheader.bfType != 0x4D42) return false;
                    bmpfile.read((char *)&bmpinfoheader, sizeof(bmpinfoheader));
                    if(bmpinfoheader.biWidth == 0 || bmpinfoheader.biHeight == 0) return false;
                    if(bmpinfoheader.biWidth != 100 || bmpinfoheader.biHeight != 100) return false;
                    if(bmpinfoheader.biPlanes != 1) return false;
                    if(bmpinfoheader.biBitCount != 24 && bmpinfoheader.biBitCount != 32) return false;
                    if(bmpinfoheader.biCompression != 0) return false;
                    if(bmpinfoheader.biSizeImage % 4 != 0) return false;
            }
            ofstream outfile[10];
            int bit = bmpinfoheader.biBitCount / 8;
            char *buf = new char[100 * bit];
            for(int i=0; i<10; i++) {
                    char str[20];
                    for(int j=0; j<10; j++) {
                            sprintf(str, "%d", i * 10 + j + 1);
                            strcat(str, ".bmp\0");
                            outfile[j].open((char *)str, ios::out|ios::binary);
                            bmpinfoheader.biWidth = 10;
                            bmpinfoheader.biHeight = 10;
                            bmpinfoheader.biSizeImage = ((10 * bit + 3) / 4) * 4 * 10;
                            bmpfileheader.bfSize = bmpinfoheader.biSizeImage + sizeof(bmpfileheader) + sizeof(bmpinfoheader);
                            outfile[j].write((char *)&bmpfileheader, sizeof(bmpfileheader));
                            outfile[j].write((char *)&bmpinfoheader, sizeof(bmpinfoheader));
                    }
                    for(int j=0; j<10; j++) {
                            for(int k=0; k<10; k++) {
                                    bmpfile.read(buf, 10 * bit);
                                    outfile[k].write(buf, 10 * bit);
                                    if(bit = 3) {
                                            outfile[k].put(0);
                                            outfile[k].put(0);
                                    }
                            }
                    }
                    for(int j=0; j<10; j++) {
                            outfile[j].close();
                    }
            }
            delete[] buf;
            return true;
    }