Subversion Repositories public

Rev

Rev 159 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 159 Rev 232
Line 20... Line 20...
20
#include <iostream>
20
#include <iostream>
21
#include <qimage.h>
21
#include <qimage.h>
22
#include <kmessagebox.h>
22
#include <kmessagebox.h>
23
#include <klocale.h>
23
#include <klocale.h>
24
#include <qstring.h>
24
#include <qstring.h>
25
#include <qcstring.h>
25
//#include <qcstring.h>
26
#include "transform.h"
26
#include "transform.h"
27
 
27
 
28
using std::cout;
28
using std::cout;
29
using std::cerr;
29
using std::cerr;
30
using std::clog;
30
using std::clog;
Line 164... Line 164...
164
	if (!latLonToPix (_rlat, _rlon, &a, &b))
164
	if (!latLonToPix (_rlat, _rlon, &a, &b))
165
	   return false;
165
	   return false;
166
 
166
 
167
	if (!src.load (fName))
167
	if (!src.load (fName))
168
	{
168
	{
169
	   KMessageBox::error(0, i18n("Error loading image file " + fName + "!"));
169
	   KMessageBox::error(0, i18n("Error loading image file %1!").arg(fName));
170
	   return false;
170
	   return false;
171
	}
171
	}
172
 
172
 
173
	w = a - x;
173
	w = a - x;
174
	h = b - y;
174
	h = b - y;
175
 
175
 
176
	dst.create(w, h, 32);
176
//	dst = QImage(w, h, 32);
177
	dst.fill(0xc0c0c0);
177
//	dst.fill(0xc0c0c0);
178
	bitBlt (&dst, 0, 0, &src, x, y, w, h, 0);
178
//	bitBlt (&dst, 0, 0, &src, x, y, w, h, 0);
-
 
179
	dst = src.copy (x, y, w, h);
179
 
180
 
180
	if (!dst.save (fName + "_tmp.png", "PNG"))
181
	if (!dst.save (fName + "_tmp.png", "PNG"))
181
	{
182
	{
182
	   KMessageBox::error(0, i18n("Error saving a temporary image file!"));
183
	   KMessageBox::error(0, i18n("Error saving a temporary image file!"));
183
	   return false;
184
	   return false;