Hi,
I'm having a custom control (with paint and erase background event ) on top of a transparent parent frame (moveable using mouse event) and i'm trying to draw a transparent png to the centre of the control without any luck.
What i'm getting is an image with black rectangle as background!. please see the attached screenshot which has two custom controls with centered image.
Is there any way we can draw png file with transparency?
Test Source code <Test.zip> attached.
Thanks in advance
Custom control with transparent parent
Custom control with transparent parent
- Attachments
-
- Test.zip
- Test Source Code
- (6.94 KiB) Downloaded 350 times
Last edited by rajan_m on Tue Jul 31, 2012 7:26 am, edited 1 time in total.
Every exit is an entry somewhere else!
-
- Experienced Solver
- Posts: 65
- Joined: Sun Oct 26, 2008 5:15 am
- Location: Chennai, India
- Contact:
Re: Transparent control with transparent bitmap
Rajan sir,
Have you tried with wxTRANSPARENT_WINDOW|wxBORDER_NONE option in your class Transparent?
Have you tried with wxTRANSPARENT_WINDOW|wxBORDER_NONE option in your class Transparent?
Regards,
Nelson Joseph
Nelson Joseph
Re: Transparent control with transparent bitmap
Nelson thanks for your reply. Yes i tried with wxTRANSPARENT_WINDOWand wxBORDER_NONE style for the transparent control but the problem is the background is not updated when we move the parent frame.
Every exit is an entry somewhere else!
-
- Experienced Solver
- Posts: 65
- Joined: Sun Oct 26, 2008 5:15 am
- Location: Chennai, India
- Contact:
Re: Custom control with transparent parent
Sir,
Try to create a Shape class which is derived from wxObject and also use wxMemoryDC.
Also see the dragimag example code in wxWidgets' samples directory.
Try to create a Shape class which is derived from wxObject and also use wxMemoryDC.
Also see the dragimag example code in wxWidgets' samples directory.
Regards,
Nelson Joseph
Nelson Joseph