daily pastebin goal
71%
SHARE
TWEET

Untitled

a guest Jul 12th, 2018 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <windows.h>
  3. using namespace std;
  4.  
  5.  
  6. int main()
  7. {
  8.     FILE * fp;
  9.     fp = fopen("ghostorgan.bmp","rb");
  10.     if(fp==NULL)
  11.     {
  12.      cout << "Error opening file";
  13.     }
  14.    
  15.     BITMAPFILEHEADER bmfh;  //Load file header into bmfh
  16.     fread(&bmfh,sizeof(BITMAPFILEHEADER),1,fp);
  17.     BITMAPINFOHEADER bmih;  //load info header into bmfh              
  18.     fread(&bmih,sizeof(BITMAPINFOHEADER),1,fp);
  19.    
  20.     DWORD size;
  21.     size=bmfh.bfSize-bmfh.bfOffBits;
  22.    
  23.     BYTE *tempPixelData;
  24.     tempPixelData=new BYTE[size];
  25.     if(tempPixelData==NULL) {
  26.         fclose(fp);
  27.         return false;
  28.         }
  29.        
  30.     fread(tempPixelData,sizeof(BYTE),size,fp);
  31.     cout << tempPixelData
  32.    
  33.     fclose(fp);
  34.     system("pause");
  35.     return 0;
  36. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top