Mercurial > mercurial > hgweb_rubikcolor.cgi
changeset 2:9675e40f5b76 default tip
clean up source-code.
author | pyon@macmini |
---|---|
date | Thu, 29 Aug 2013 19:20:13 +0900 |
parents | a14406960539 |
children | |
files | Makefile main.cpp |
diffstat | 1 files changed, 6 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/main.cpp Tue Jul 30 05:51:47 2013 +0900 +++ b/main.cpp Thu Aug 29 19:20:13 2013 +0900 @@ -1,5 +1,5 @@ // Filename : main.cpp -// Last Change: 29-Jul-2013. +// Last Change: 29-Aug-2013. // #include "wx/wxprec.h" #ifndef WX_PRECOMP @@ -10,6 +10,7 @@ #include <wx/bitmap.h> #include <wx/image.h> +#define RATE 4 // private classes // Define a new application type, each program should derive a class from wxApp @@ -127,8 +128,9 @@ wxCmdLineParser( g_cmdLineDesc, argc, argv ); - image.Create( 19, 19, false ); - image.SetRGB( wxRect( 0, 0, 19, 19 ), -1, -1, -1 ); + int len = 19 * RATE; + image.Create( len, len, false ); + image.SetRGB( wxRect( 0, 0, len, len ), -1, -1, -1 ); wxImage::AddHandler( new wxPNGHandler ); return true; @@ -240,7 +242,7 @@ void MyApp::SetImageData( int x, int y, int w, int h, wxString color ) { - wxRect rect( x, y, w, h ); + wxRect rect( x * RATE, y * RATE, w * RATE, h *RATE ); if ( color.IsSameAs( wxT("black"), true ) ) image.SetRGB( rect, 0, 0, 0 ); else if ( color.IsSameAs( wxT("white"), true ) ) image.SetRGB( rect, 255, 255, 255 ); else if ( color.IsSameAs( wxT("yellow"), true ) ) image.SetRGB( rect, 255, 255, 0 );