This software is developed for interet users. Now-a-days
there is a small problem for dialup users(usually) ie. if we
have connected the system to internet for downloading
in the night time and if the mobile battery power is running
lower, the mobile will be powered off and the net wil be
disconnected and the system will be in the ON state till
furthe user interactions, this will charge a lot of power.
So i developed this software to counter this, it will monitor
the system and will power off automatically whenever
the net connection is terminated.
How to install?
--------------
OPEN SETUP.EXE
Pre-Requesties?
---------------
.net Framework 2.0 or higher
Developed by
Aravind NC
n.c.aravind@gmail.com
aravind_n_c@yahoo.co.in
Download Now
Friday, February 5, 2010
Bitmap Image file Validator/Checker
I've created this program as a part of a project 'Image Enhancer'. This Program can be used
//Checking and validation of an BMP ImageFile
#include
#include
#include
#include
#include
#include
#include
#define BMPTYPE (((WORD) 'M' << 8) | 'B') /* 1st 2bytes must=='BM' */ typedef unsigned char BYTE; typedef unsigned short WORD; typedef unsigned long DWORD; typedef struct tagBMPFILEHEADER { WORD bfType; WORD bfSize; } BMPFILEHEADER; typedef struct tagBMPINFOHEADER { DWORD biSize; DWORD biWidth; DWORD biHeight; WORD bibitCount; DWORD biSizeImage; DWORD biClrUsed; } BMPINFOHEADER; void bmp( FILE *bmpfp) { BMPFILEHEADER bmfh; BMPINFOHEADER bmih; int i, j; printf("\nReading file.\n"); delay(2000); if( fread( &bmfh, sizeof( BMPFILEHEADER), 1, bmpfp) != 1) { printf("Error reading file.\n"); printf("Try again.."); getch(); }else { printf("\nHeader Reading Successfully Completed.\n"); delay(2000); if( fread( &bmih, sizeof( BMPINFOHEADER), 1, bmpfp) != 1) { printf("Error reading file info header...\n"); printf("Try again.."); getch(); } else { printf("\nChecking the file # 1.\n"); if( bmfh.bfType != BMPTYPE) { printf(".BMP is not a valid bitmap.\n"); return; } else { printf("\nSuccessfully Completed file type checking.\n"); // printf("bfType Value:%d",bmfh.bfType); } printf("\nChecking the file # 2.\n"); delay(2000); if( bmih.bibitCount != 24) { printf("Not a valid 24bit BMP file.\nPress to Exit"); } else { printf("\nSuccessfully completed bitcount check.\n"); // printf("BitCount Value:%d",bmih.bibitCount); printf("\nThis is a valid BMP Image File..\nFile Details are..."); } // printf("Header: %ld bytes\nImage: %ld bytes\n", // bmih.biSize, bmfh.biSizeImage); // printf("Pixels %ld x %ld\n Colors: %ld\n", // bmih.biWidth, bmih.biHeight, bmih.biClrUsed); return; } }} void main()//( int argc, char **argv) { clrscr(); char inname[100]; int i,length; printf("* * * * * * BMP Image Validator * * * * *\n"); printf("_________________________________________\n\n\n\n"); printf("\nEnter the file path(Ex=c:\tc\text.bmp):"); scanf("%s",&inname); length = strlen(inname); for (i = 0; i < length; i++) { if ((inname[i] >= 'a') && (inname[i] <= 'z')){
inname[i] = toupper(inname[i]);
}
}
//fpath=inname;
FILE *infp;
//strcpy( inname, argv[1]);
infp = fopen( inname, "r");
if( ! infp)
{
printf("\n Unable to open %s for input\n", inname);
printf("Try again..");
getch();
//main();
// exit(1);
}
printf("Verifying file....");
delay(1000);
bmp(infp);
fclose(infp);
printf("\nPress any key to exit\n");
getch();
// exit(0);
}
//Checking and validation of an BMP ImageFile
#include
#include
#include
#include
#include
#include
#include
#define BMPTYPE (((WORD) 'M' << 8) | 'B') /* 1st 2bytes must=='BM' */ typedef unsigned char BYTE; typedef unsigned short WORD; typedef unsigned long DWORD; typedef struct tagBMPFILEHEADER { WORD bfType; WORD bfSize; } BMPFILEHEADER; typedef struct tagBMPINFOHEADER { DWORD biSize; DWORD biWidth; DWORD biHeight; WORD bibitCount; DWORD biSizeImage; DWORD biClrUsed; } BMPINFOHEADER; void bmp( FILE *bmpfp) { BMPFILEHEADER bmfh; BMPINFOHEADER bmih; int i, j; printf("\nReading file.\n"); delay(2000); if( fread( &bmfh, sizeof( BMPFILEHEADER), 1, bmpfp) != 1) { printf("Error reading file.\n"); printf("Try again.."); getch(); }else { printf("\nHeader Reading Successfully Completed.\n"); delay(2000); if( fread( &bmih, sizeof( BMPINFOHEADER), 1, bmpfp) != 1) { printf("Error reading file info header...\n"); printf("Try again.."); getch(); } else { printf("\nChecking the file # 1.\n"); if( bmfh.bfType != BMPTYPE) { printf(".BMP is not a valid bitmap.\n"); return; } else { printf("\nSuccessfully Completed file type checking.\n"); // printf("bfType Value:%d",bmfh.bfType); } printf("\nChecking the file # 2.\n"); delay(2000); if( bmih.bibitCount != 24) { printf("Not a valid 24bit BMP file.\nPress to Exit"); } else { printf("\nSuccessfully completed bitcount check.\n"); // printf("BitCount Value:%d",bmih.bibitCount); printf("\nThis is a valid BMP Image File..\nFile Details are..."); } // printf("Header: %ld bytes\nImage: %ld bytes\n", // bmih.biSize, bmfh.biSizeImage); // printf("Pixels %ld x %ld\n Colors: %ld\n", // bmih.biWidth, bmih.biHeight, bmih.biClrUsed); return; } }} void main()//( int argc, char **argv) { clrscr(); char inname[100]; int i,length; printf("* * * * * * BMP Image Validator * * * * *\n"); printf("_________________________________________\n\n\n\n"); printf("\nEnter the file path(Ex=c:\tc\text.bmp):"); scanf("%s",&inname); length = strlen(inname); for (i = 0; i < length; i++) { if ((inname[i] >= 'a') && (inname[i] <= 'z')){
inname[i] = toupper(inname[i]);
}
}
//fpath=inname;
FILE *infp;
//strcpy( inname, argv[1]);
infp = fopen( inname, "r");
if( ! infp)
{
printf("\n Unable to open %s for input\n", inname);
printf("Try again..");
getch();
//main();
// exit(1);
}
printf("Verifying file....");
delay(1000);
bmp(infp);
fclose(infp);
printf("\nPress any key to exit\n");
getch();
// exit(0);
}
Subscribe to:
Posts (Atom)
Popular Posts
-
Some times when you connect to the webhost via FileZilla you may encounter this error message. "421 Sorry, cleartext sessions are ...
-
Q: Can I start my own company on oDesk? A: Yes! oDesk allows you to build and manage a team of workers, colleagues and collaborators. Yo...
-
global $COURSE, $USER; $context = get_context_instance(CONTEXT_COURSE,$COURSE->id); if (has_capability('moodle/legacy:student', ...
-
Do you know It-s possible create Table without using mouse and menus in MS word and Outlook. Here its that… Type the content ( +--+---...
-
1. Open a blank notepad document 2. Copy and paste the following code into the blank notepad You are not using mod_rewrite - Try LINK2...
-
Use the below code to create a calendar event in PHP and send it as email to Microsoft Outlook or iPhone Calendar. < ?php /** * @cate...
-
Lots of times when you're developing a site, you'll want to have a snippet of text in one place. PHP doesn't really have a goo...
-
GitHub Link: https://github.com/aravindnc/A-to-Z-List-of-Useful-Node.js-Modules Use Ctrl + F or command + F to search for a module. ...
-
The CSS frameworks here offer designers a structure going into their projects, so they aren’t starting entirely from scratch. Some offer lay...
-
In Joomla most probably after upgradation users will encounter an error, that is they cannot edit articles or sections. You can fix this b...