This commit is contained in:
parent
fd8dc03f93
commit
5f5a903a8e
|
@ -0,0 +1,9 @@
|
|||
#include<iostream>
|
||||
#include<math.h>
|
||||
using namespace std;
|
||||
|
||||
int main(){
|
||||
int a = 9;
|
||||
cout << floor(a/4) << endl;
|
||||
return 0;
|
||||
}
|
6
zoom.cpp
6
zoom.cpp
|
@ -24,7 +24,8 @@ int main(int argc, char ** argv)
|
|||
pColorTableSize = 1024;
|
||||
|
||||
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];
|
||||
fread(pBmpBuf, lineByte*height, 1, fp);
|
||||
fclose(fp);
|
||||
|
@ -38,7 +39,8 @@ int main(int argc, char ** argv)
|
|||
scanf("%f", &k);
|
||||
int dstWidth = round(double(k*width));
|
||||
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;
|
||||
pBmpBuf2 = new unsigned char[lineByte2*dstHeight];
|
||||
|
|
Loading…
Reference in New Issue