Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » Showing Images in a Child Frame
Showing Images in a Child Frame [message #17710] |
Wed, 27 August 2008 11:46  |
SirKline
Messages: 3 Registered: August 2008 Location: Germany
|
Junior Member |
|
|
Hi There,
I'm not sure how trivial my question is, but i just can't find out how to display images in a child frame. I started windows programming with upp so my windows programming skills are not so well.
Anyway my paint() is only working with the top frame and i can't figure out how to paint in a child frame.
Thanks in Advance,
SirKline
|
|
|
Re: Showing Images in a Child Frame [message #17717 is a reply to message #17710] |
Wed, 27 August 2008 13:23   |
mrjt
Messages: 705 Registered: March 2007 Location: London
|
Contributor |
|
|
Hi and welcome!
I'm afraid you haven't really given enough information for a definitive answer, and there are probably several ways of doing it depending on exactly how you want it to look.
Paint() is clipped to the client area of a ctrl. Frames are objects and responsible for drawing themselves. The simplest way :
// Member variable for the frame (change to Top/Left etc.)
FrameRight<ImageCtrl> imageframe;
...
// In constructor
Image img = AppImg::some_image();
imageframe.SetImage(img);
AddFrame(imageframe.Width(img.GetWidth()));
But if that's not what you're after, post some more info and we'll help you out.
[Updated on: Wed, 27 August 2008 13:27] Report message to a moderator
|
|
|
|
|
|
Re: Showing Images in a Child Frame [message #17738 is a reply to message #17736] |
Wed, 27 August 2008 19:11   |
mrjt
Messages: 705 Registered: March 2007 Location: London
|
Contributor |
|
|
I would suggest creating a custom widget based on Ctrl, and overloading it's Paint method to draw the cards.
Something like:
class CardView : public Ctrl
virtual void Paint(Draw &w) {
w.DrawRect(GetSize(), SColorFace);
// Draw cards
}
};
As long as you declare this before you include your .lay file (or include a header with it in) you can add CardView to your child window's layout using 'User class' from the Layout Manager context menu.
[Updated on: Wed, 27 August 2008 19:12] Report message to a moderator
|
|
|
|
Goto Forum:
Current Time: Sat Apr 26 21:55:14 CEST 2025
Total time taken to generate the page: 0.00877 seconds
|