Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous message
slashupp is currently offline  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

 
Read Message
Read Message
Read Message
Previous Topic: [GLCtrl] Adding an Initilisation function to GLPaint
Next Topic: [Proposal] EditSecret dialogs (EditText variants), for password, etc input..
Goto Forum:
  


Current Time: Thu Jul 18 04:49:07 CEST 2024

Total time taken to generate the page: 0.01146 seconds