summaryrefslogtreecommitdiff
path: root/utility/demo-fw/pc-tools/CreateDemoBin/lib/EasyBMP/sample/EasyBMPsample.cpp
blob: 2b25ca22f0f888a15826bc1efe5052d27f6a3dd7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*************************************************
*                                                *
*  EasyBMP Cross-Platform Windows Bitmap Library * 
*                                                *
*  Author: Paul Macklin                          *
*   email: macklin01@users.sourceforge.net       *
* support: http://easybmp.sourceforge.net        *
*                                                *
*          file: EasyBMPsample.cpp               * 
*    date added: 03-31-2006                      *
* date modified: 12-01-2006                      *
*       version: 1.06                            *
*                                                *
*   License: BSD (revised/modified)              *
* Copyright: 2005-6 by the EasyBMP Project       * 
*                                                *
* description: Sample application to demonstrate *
*              some functions and capabilities   *
*                                                *
*************************************************/

#include "EasyBMP.h"
using namespace std;

int main( int argc, char* argv[] )
{
 cout << endl
      << "Using EasyBMP Version " << _EasyBMP_Version_ << endl << endl
      << "Copyright (c) by the EasyBMP Project 2005-6" << endl
      << "WWW: http://easybmp.sourceforge.net" << endl << endl;
	  
 BMP Text;
 Text.ReadFromFile("EasyBMPtext.bmp");
  
 BMP Background;
 Background.ReadFromFile("EasyBMPbackground.bmp");
  
 BMP Output;
 Output.SetSize( Background.TellWidth() , Background.TellHeight() );
 Output.SetBitDepth( 24 );
 
 RangedPixelToPixelCopy( Background, 0, Output.TellWidth()-1,
                         Output.TellHeight()-1 , 0, 
                         Output, 0,0 );	
						 
 RangedPixelToPixelCopyTransparent( Text, 0, 380, 
                                    43, 0,
									Output, 110,5, 
									*Text(0,0) );

 RangedPixelToPixelCopyTransparent( Text, 0, Text.TellWidth()-1, 
                                    Text.TellWidth()-1, 50,
									Output, 100,442, 
									*Text(0,49) );
					
 Output.SetBitDepth( 32 );
 cout << "writing 32bpp ... " << endl;					
 Output.WriteToFile( "EasyBMPoutput32bpp.bmp" );

 Output.SetBitDepth( 24 );
 cout << "writing 24bpp ... " << endl;			
 Output.WriteToFile( "EasyBMPoutput24bpp.bmp" );
 
 Output.SetBitDepth( 8 );
 cout << "writing 8bpp ... " << endl;					
 Output.WriteToFile( "EasyBMPoutput8bpp.bmp" );

 Output.SetBitDepth( 4 );
 cout << "writing 4bpp ... " << endl;					
 Output.WriteToFile( "EasyBMPoutput4bpp.bmp" );
 
 Output.SetBitDepth( 1 );
 cout << "writing 1bpp ... " << endl;					
 Output.WriteToFile( "EasyBMPoutput1bpp.bmp" );
 
 Output.SetBitDepth( 24 );
 Rescale( Output, 'p' , 50 );
 cout << "writing 24bpp scaled image ..." << endl;
 Output.WriteToFile( "EasyBMPoutput24bpp_rescaled.bmp" );

 return 0;
}
personal git repositories of Harald Welte. Your mileage may vary