Mixing bitmaps and FloatPanel?

Well, I've been evaluating OGL for a project but now I'm looking at FloatPanel.

It looks really nice but has no bitmap support. That isn't too big of a problem, but if I were to manually draw a bitmap onto the FloatPanel, would that work? I assume I'd have to catch the paint event since FloatPanel wouldn't know about it.

Regards,
Nate

FloatCanvas, not FloatPanel. D'oh.

···

On Apr 1, 2005, at 12:33 PM, Nate Silva wrote:

Well, I've been evaluating OGL for a project but now I'm looking at FloatPanel.

It looks really nice but has no bitmap support. That isn't too big of a problem, but if I were to manually draw a bitmap onto the FloatPanel, would that work? I assume I'd have to catch the paint event since FloatPanel wouldn't know about it.

Regards,
Nate

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

Nate Silva wrote:

FloatCanvas, not FloatPanel. D'oh.

I was wondering about that...but FloatCanvas is a wx.Panel, so you're partly right.

Well, I've been evaluating OGL for a project but now I'm looking at FloatPanel.

I you tell me more about your intended use, I can help you decide if it's appropriate.

It looks really nice but has no bitmap support. That isn't too big of a problem, but if I were to manually draw a bitmap onto the FloatPanel, would that work? I assume I'd have to catch the paint event since FloatPanel wouldn't know about it.

You could do that, but it would be kind of a pain. Much better would be to add a bitmap DrawObject. If you want it Scalable, model it after the ScaledText DrawObject. If you want it non-scaled, model it after the Text DrawObject. I haven't really documented the protocol required for a DrawObject, but if you look at the code, it should be pretty clear what methods are required.

I've been intending to do this for ages, but haven't gotten around to it yet. If you start it, I'll be glad to help.

-Chris

Chris Barker wrote:

Much better would be
to add a bitmap DrawObject. If you want it Scalable, model it after the ScaledText DrawObject. If you want it non-scaled, model it after the Text DrawObject. I haven't really documented the protocol required for a DrawObject, but if you look at the code, it should be pretty clear what methods are required.

I've been intending to do this for ages, but haven't gotten around to it yet. If you start it, I'll be glad to help.

OK, you got me thinking, so I got it started. I've enclosed a small module that adds a Bitmap Object (non-scaled) it turned out to be very easy! I've also enclosed a tiny demoApp to test it. I'll integrate this into FloatCanvas soon. I'll leave as an exercise for the reader to implement the scalable one! (hint, you'll need to use wx.Image to do the scaling, and it could be kind of slow)

-Chris

BitmapObject.py (1.48 KB)

TestBitmap.py (3.5 KB)

Thanks for that! I'm testing some other things right now so I haven't tried your code yet, but it looks promising.

To answer your question about what the application does: it displays a representation of a die-cut label; the user adds text to it and optionally a few graphics. So I'm looking at both OGL and FloatCanvas and bitmap support is going to be helpful.

Regards,
Nate

···

On Apr 1, 2005, at 11:42 PM, Chris Barker wrote:

Chris Barker wrote:

Much better would be
to add a bitmap DrawObject. If you want it Scalable, model it after the ScaledText DrawObject. If you want it non-scaled, model it after the Text DrawObject. I haven't really documented the protocol required for a DrawObject, but if you look at the code, it should be pretty clear what methods are required.
I've been intending to do this for ages, but haven't gotten around to it yet. If you start it, I'll be glad to help.

OK, you got me thinking, so I got it started. I've enclosed a small module that adds a Bitmap Object (non-scaled) it turned out to be very easy! I've also enclosed a tiny demoApp to test it. I'll integrate this into FloatCanvas soon. I'll leave as an exercise for the reader to implement the scalable one! (hint, you'll need to use wx.Image to do the scaling, and it could be kind of slow)