wxPython help please

J

Jive Dadson

I hope someone can help me with a couple of wxPython questions, or point
me to the right newsgroup for the questions.

I am trying to modify the floatcanvas demo program. I want to load an
image from a file (jpg or whatever), then do a kind of color-picker
action on it.

I haven't tried yet to figure out how to load the file. Just for
starters, when I click on the canvas, I want to get the rgb pixel value
for the point under the cursor. I can't for the life of me figure out
how to do it. I suppose it begins with event.GetPosition(), but after
that I am at a loss.

The larger question is how to use wxPython. It's got such fabulous
stuff, but every time I try to do anything with it, I eventually give up
because I can't find adequate documentation. I know very little about
graphics programming.

Please respond here. Because of spammers, the email address is fake.

Thanks,
"Jive"
 
S

Sandra-24

Try the wxPython mailing list, which you can find on their site. And
the best wxPython reference is the book (also available as an e-book)
by Robin Dunn, who created wxPython. Seeing wxPython from his
perspective is well worth the money. If I recall correctly he devoted
an entire chapter to drawing with a canvas widget.

-Sandra
 
J

Jive Dadson

Sandra-24 said:
Try the wxPython mailing list, which you can find on their site. And
the best wxPython reference is the book (also available as an e-book)
by Robin Dunn, who created wxPython. Seeing wxPython from his
perspective is well worth the money. If I recall correctly he devoted
an entire chapter to drawing with a canvas widget.

-Sandra

Thanks. I'll give it a look see.

You understand that what I want to do is get the pixel that's under the
cursor when I click, right? I don't really need to draw things, only
load an image from a file. But since this program already did so much
of what I wanted, I decided to try it. It is frustrating that after a
couple of hours I still can't figure out how to read a danged pixel.
 
J

Jive Dadson

Sandra-24 said:
Try the wxPython mailing list, which you can find on their site. And
the best wxPython reference is the book (also available as an e-book)
by Robin Dunn, who created wxPython. Seeing wxPython from his
perspective is well worth the money. If I recall correctly he devoted
an entire chapter to drawing with a canvas widget.

-Sandra


I bought the ebook. Searching for "pixel", all I came up with was a
method called GetPixel in a "device context." I know there must be a
device context buried in there somewhere, so now I need to winkle it out.
 
S

Sandra-24

I bought the ebook. Searching for "pixel", all I came up with was a
method called GetPixel in a "device context." I know there must be a
device context buried in there somewhere, so now I need to winkle it out.

You are right that you need to capture the mouse down event for the
canvas and get the cursor position from there. To get the rgb value for
that pixel may require the dc, I don't remember enough about them to
say for sure. You might have better luck on the mailing list, it's a
high volume list and you'll likely get a good response there.

-Sandra
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Help please 8
Please help me!!! 3
Malicious Coding Help Please 5
Can't solve problems! please Help 0
Hello and Help please :-) 1
Help with my navigation, please 0
wxPython gurus, please help 3
Code help please 4

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,118
Latest member
LatishaWhy
Top