这个大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;
解决方案 »
- sql语句中自己构造的字段不能编辑吗?
- 让程序具有类似屏保的功能,请大家给点建议
- 郁闷!散点分!!!
- 如何将datetime数据类型加3年后,再赋给datetime类型?
- 如何在已打开的当前excel文件中插入一行记录,excel文件是新建的事先不知道文件名。(excel是在程序里打开的)
- mssql 2000+delphi 开发完后客户怎样升级数据库又不破坏原来客户录入表的数据
- 多窗体问题
- 求:谁有立方体旋转的程序?需要源代码!谢谢,万分焦急!!!谢谢,100分送!!!
- 在DELPHI中有沒有直接比較兩個用QUERY查詢的記錄集是否相同的函數或方法﹐
- 向各路高手请教~~ 我想做个从右向左滚动的广告条,以为很简单,但是就是一些细节问题搞得狂人莫名其妙。。。
- 急需vclzip for bcb6的注册版,谁有发给我,兄弟感激不尽,100分送上!
- 关于close的疑问
{
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;
}