[Qtce-preview-feedback] WM6 can't read certain files
Robert Graebert
robert.graebert at graebert.com
Tue Apr 29 20:17:25 CEST 2008
Matthias,
you will get problems with even smaller images. The problem is the
Bluetooth and 802.11 drivers have the habit of spreading themselves all
over the virtual address space of your process. You will be lucky if you
get more then a 1Mb continuous chunk on all devices.
Check out:
http://blogs.msdn.com/hegenderfer/archive/2007/08/31/slaying-the-virtual-memory-monster.aspx
http://msdn2.microsoft.com/en-us/library/ms836325.aspx
There are two things you can do:
1. Split your image up into strips and allocate separately.
2. Use the only place where you are going to get a large chunk of free
address space: The memory mapped file area. You will need to use
CreateFileMapping and MapViewOfFile. There you can allocate up to 2GB of
virtual memory.
Happy coding,
Robert
Matthias Van Woensel schrieb:
> Maurice,
>
> We found out what the problem is. Apparently, windows ce 5 (windows
> mobile 5 and windows mobile 6) have a virtual memory limit of 32MB for
> each process. We were trying to display a 1600x1400pixel 32bit image
> and that pushed it beyond the limit.
> According to microsoft, windows ce 6 (windows mobile 7?) will not have
> that limit anymore. But for now, we're stuck with it, so we're gonna
> try cutting down on memory usage by taking the pictures in 16bit.
>
> I hope this knowledge helps someone in the future, thanks for the help.
>
> Regards
> Matthias
>
> On Mon, Apr 28, 2008 at 5:14 PM, Matthias Van Woensel
> <matthias at fotodegroot.be <mailto:matthias at fotodegroot.be>> wrote:
>
> Maurice,
>
> We deployed the application with the qjpeg plugin (we know it
> works because other jpg's work fine).
> We use the same piece of code that you gave as an example in our
> application. The qfile::readAll() was just to see what exactly was
> causing the problem.
> The qDebug output of readAll() is "ÿØÿà . We also still have like
> 80MB ram free on the device so I doubt it's a memory related problem.
>
> Regards
> Matthias
> On Mon, Apr 28, 2008 at 4:06 PM, Maurice Kalinowski
> <mkalinow at trolltech.com <mailto:mkalinow at trolltech.com>> wrote:
>
> Hi,
>
> Matthias Van Woensel wrote:
> > Attached to this email you'll find a JPG file which opens
> fine in any
> > imagebrowser (except for Qt on wince).
> > When a QFile::readAll() is done on the file on qtce it fails
> to read
> > the data (tested on both WM5 and WM6).
> >
> Unfortunately I was not able to reproduce this issue here.
>
> Do you deploy the jpeg imageformat plugin to the device to be
> able to
> display images of this format?
> You can do this automatically by adding
> DEPLOYMENT_PLUGIN += qjpeg
> to your pro file and then recreating the visual studio project.
>
> Furthermore I am a little bit concerned why you use
> QFile::readAll() for
> displaying an image. Though I have tried that too, the usual
> way would
> be something like:
> QPixmap pixmap("GP_1.jpg");
> if (pixmap.isNull()) {
> qDebug() << "Invalid image";
> return -1;
> }
>
> QLabel* imageLabel = new QLabel;
> imageLabel->setPixmap(pixmap);
> imageLabel->show();
>
> Do you get any error messages while debugging? The only
> situation I
> could think of so far is that your device is running out of
> memory as
> the image is rather big?
>
>
> Best Regards,
>
> Maurice Kalinowski
>
> _______________________________________________
> Qtce-preview-feedback mailing list
> Qtce-preview-feedback at trolltech.com
> <mailto:Qtce-preview-feedback at trolltech.com>
> http://lists.trolltech.com/mailman/listinfo/qtce-preview-feedback
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Qtce-preview-feedback mailing list
> Qtce-preview-feedback at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qtce-preview-feedback
>
--
Robert Graebert
CTO
Graebert GmbH
Nestorstr. 36a
10709 Berlin
Germany
--------------------------------------------------------
Phone.: +49 (0) 30 896903-59
Fax.: +49 (0) 30 896903-12
Email: robert.graebert at graebert.com
Homepage: http://www.graebert.com
========================================
Commercial Registry: Berlin-Charlottenburg HRB 32314
Director: Mr. Wilfried Graebert
VAT No: DE 136614135
--------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.trolltech.com/pipermail/qtce-preview-feedback/attachments/20080429/f4bfd2cb/attachment.html
More information about the Qtce-preview-feedback
mailing list