how to create an array of PtPixel widgets

hi,
how do i create multiple ptpixel widgets (around 800,000 points) which each point can have its own set of attribute(color, intensity etc)? The code needs to recide in a callback. feel free to throw out any solution.

thanks for reading.

800,000 points represent an image of about 894x894. That’s a LOT of pixels. You are not saying what is it you want to acheive, but handling 800,000 widget is going to be slow.

Stab in the dark, why not use a bitmap instead and deal with each pixel directly. Treat 800,000 pixels as one big image ?

thanks Mario,
yup, u guess rite. it is use to draw a big image file. the input source is from a text file storing the intensity for each pixel. how can deal with the bitmap directly?

Up ^^

I’m interested in this one…
I came out with the following code:

[code]unsigned char *pimage;
PhPoint_t p = {10, 10};
PhDim_t s = {10, 10};

pimage = malloc(300 * sizeof(char));
for (i = 0; i < 100; i++)
{
pimage[i * 3] = 0;
pimage[i * 3 + 1] = 0;
pimage[i * 3 + 2] = 255;
}
PgDrawImage(pimage, Pg_IMAGE_DIRECT_888, &p, &s, 30, 0);[/code]

This is of course just a testing function, I want to do useful things with it in the end ;-)
So the goal is to display a 10*10 blue square on my window.
The code seems ok, PgDrawImage gives me zero.

My guess is the next step is to somehow attach the image to some widget, but the documentation is (as usual) not very clear about how to do that. “Refer to this”, and “better if u do this”, and “go check there”, and incomplete examples.

So where should I put my image so that it displays on the window when I run the program ? I guess I should define it someway as an attribute of a widget, but I can’t find the appropriate way to do this.

If you want to use any Pg* routines in an application that uses widgets, you should use a PtRaw widget and do everything in the widget’s draw function. See the Raw Drawing and Animation chapter of the Photon Programmer’s Guide.

There, I’ve told you “refer to this.” :slight_smile:

Ok, got it ^^
Now I’ve got a nice blue rectangle :slight_smile:

Thanks for pointing out where I should look ;-)

You might also want to get onto usenet and have a look at the subject “PtRaw drawing questions” in the qnx.gui group on nntp://inn.qnx.com

Btw: Mozilla does a wonderful job of managing usenet.

qnx.gui is also mirrored here:

openqnx.com/index.php?name=P … forum&f=17

Neat, how long has those been there?

It’s been there since the first day qnx.* groups were created ;)

Actually, it was there from the early days of openqnx.com but it was mirroring the qdn.* groups at that time.

Thanks for the link ^^