Skip navigation.
The QNX Community Portal

View topic - Loading embedded images

Loading embedded images

Isn't the name clear?

Loading embedded images

Postby ian_turner » Tue Jan 26, 2010 10:29 am

I have an existing application that reads in a design that is a mixture of textual layout commands and embedded images and translates it into the applications standard design form. The OS it currently runs on includes a routine to load a bitmap from a filehandle but as far as I can ascertain QNX only has PxloadImage which insists that a bitmap is a complete file.
Are there functions I am overlooking that can read from an already open file as otherwise I am considering either reading into a temporary file and using Pxloadimage or saving each image as a file named filenameX.bmp where filename is the name of the translated design and X a counter and abandoning the idea of embedded bitmaps in my design files altogether (as obviously I will have to do this on the translated designs if I continue to embed bitmaps or write my own routines to load and convert from black and white to direct 888 format)
Active Member
Posts: 12
Joined: Fri Oct 30, 2009 9:36 am

RE: Loading embedded images

Postby mario » Tue Jan 26, 2010 3:24 pm

There is no such function as far as I know. You need to come up with your own solution. However if all you need to handle is the bitmap format it`s a very easy format to handle and you will find plenty of code on the interthingy to help you out.
QNX Master
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

RE: Loading embedded images

Postby maschoen » Tue Jan 26, 2010 4:25 pm

PxloadImage does expect the targeted file to be an image file.

You can open a file in some format that you understand which has embedded bitmaps and read them in.
What you want to do next is create a PtImage using the bitmap data. I forget the name of the routine, but just scan the Px routines and you should find it. This is only slightly more complicated than just using PxloadImage. For example, you need to know
1) pixel width
2) pixel height
3) Image format (8 bit, 15 bit, 16 bit, 24 bit, etc)
4) pixel's per line (this can be different from pixel width * bytes/pixel)

It should be fairly easy to create a cover routine for all this that you can use instead of PxLoadImage.
QNX Master
Posts: 2640
Joined: Wed Jun 25, 2003 5:18 pm

Return to GUI Programming

Who is online

Users browsing this forum: No registered users and 4 guests