Home » U++ Library support » U++ Widgets - General questions or Mixed problems » How to draw random images in ArrayCtrl-cell using Display? [SOLVED]
How to draw random images in ArrayCtrl-cell using Display? [SOLVED] [message #53656] |
Sun, 19 April 2020 08:19 |
slashupp
Messages: 231 Registered: July 2009
|
Experienced Member |
|
|
How do I pass an Image as a Value to a Display and access the image in the Display-code so I can draw it?
(The images are all of size 20x20)
E.g.:
struct MyPicDisplay : public Display
{
virtual void Paint(Draw& w, const Rect& r, const Value& q, Color ink, Color paper, dword style) const
{
w.DrawRect(r, paper);
Image img{};
img= ??? how to get it from q ???
if (!img.IsNullInstance()||img.IsEmpty()) w.DrawImage(r, img);
}
};
//background info:
void someclass::ArShowPic(Image pic)
{
//ar is an ArrayCtrl..
//the column was declared with: ar.AddColumn().SetDisplay(Single<MyPicDisplay>());
ar.Add(pic); //this invokes the display code where I have my problem.
}
[Updated on: Mon, 20 April 2020 07:02] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Fri Apr 26 01:30:51 CEST 2024
Total time taken to generate the page: 0.03820 seconds
|