This commit is contained in:
SunnyGor 2023-01-07 11:09:54 +08:00
parent fd8dc03f93
commit 5f5a903a8e
4 changed files with 13 additions and 2 deletions

9
test.cpp Normal file
View File

@ -0,0 +1,9 @@
#include<iostream>
#include<math.h>
using namespace std;
int main(){
int a = 9;
cout << floor(a/4) << endl;
return 0;
}

BIN
test.exe Normal file

Binary file not shown.

View File

@ -24,7 +24,8 @@ int main(int argc, char ** argv)
pColorTableSize = 1024; pColorTableSize = 1024;
unsigned char *pBmpBuf; unsigned char *pBmpBuf;
int lineByte = (width*biCount / 8 + 3) / 4 * 4; int lineByte = width*floor(biCount/8);
while(lineByte % 4 != 0){lineByte += 1;}
pBmpBuf = new unsigned char[lineByte*height]; pBmpBuf = new unsigned char[lineByte*height];
fread(pBmpBuf, lineByte*height, 1, fp); fread(pBmpBuf, lineByte*height, 1, fp);
fclose(fp); fclose(fp);
@ -38,7 +39,8 @@ int main(int argc, char ** argv)
scanf("%f", &k); scanf("%f", &k);
int dstWidth = round(double(k*width)); int dstWidth = round(double(k*width));
int dstHeight = round(double(k*height)); int dstHeight = round(double(k*height));
int lineByte2 = (dstWidth*biCount / 8 + 3) / 4 * 4; int lineByte2 = dstWidth*floor(biCount/8);
while(lineByte2 % 4 != 0){lineByte2 += 1;}
unsigned char*pBmpBuf2; unsigned char*pBmpBuf2;
pBmpBuf2 = new unsigned char[lineByte2*dstHeight]; pBmpBuf2 = new unsigned char[lineByte2*dstHeight];

BIN
zoom.exe

Binary file not shown.