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 » Draw, Display, Images, Bitmaps, Icons » Image with Layout (iml) painted red, why?
Image with Layout (iml) painted red, why? [message #1439] Fri, 03 March 2006 22:31 Go to next message
mechatronic is currently offline  mechatronic
Messages: 10
Registered: December 2005
Location: Viet Nam
Promising Member

This is my code:
ic555.h
#ifndef _ic555_ic555_h
#define _ic555_ic555_h

#include <CtrlLib/CtrlLib.h>
#include <stdlib.h>

#define LAYOUTFILE <ic555/ic555.lay>
#include <CtrlCore/lay.h>




class ic555 : public Withic555Layout<TopWindow> {
public:
typedef ic555 CLASSNAME;
ic555();
double s_t1, s_t2, s_T, s_f;
void Calc ();
void Paint (Draw&);
private:
double s_Ra, s_Rb, s_C;
};

#endif


main.cpp
#include "ic555.h"


#define IMAGEFILE <ic555/ic555.iml>
#include <Draw/iml.h>

ic555::ic555()
{
Title("IC555").Icon(minhhoa()).MinimizeBox(1);
BackPaint();
CtrlLayout(*this);

cmd_Calculate <<= THISBACK(Calc);
}


GUI_APP_MAIN
{
ic555().Run();
}

void ic555::Paint(Draw& p)
{
Rect w;
w.left=305;
w.top=30;
Size isz = minhhoa().GetSize();
w.SetSize(isz);
// p.DrawRect(w,SWhite);
p.DrawImage(w,minhhoa);
}

minhhoa is an image 193x155 pixel. When it ran, program window was filled with red. What's wrong in my code? Or anyone have other way to place an image into Layout.

[P.S. Topic title edited by fudadmin... Is it now what you meant? Smile]

[Updated on: Sat, 04 March 2006 18:38] by Moderator

Report message to a moderator

Re: Help-Iml Drawing [message #1440 is a reply to message #1439] Fri, 03 March 2006 22:38 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Not sure. Red color is debug mode helper - it means that area was not painted by code (a bug).

I guess that maybe left = 305 goes outside of window.

Mirek
Re: Help-Iml Drawing [message #1444 is a reply to message #1439] Sat, 04 March 2006 00:23 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
mechatronic, please learn how to create smart topic titles...
Re: Help-Iml Drawing [message #1455 is a reply to message #1444] Sat, 04 March 2006 18:00 Go to previous messageGo to next message
mechatronic is currently offline  mechatronic
Messages: 10
Registered: December 2005
Location: Viet Nam
Promising Member

Hhm, sorry. Very Happy I knew it was very ambiguous. I will pay attention to tittle.
To luzr: It's simple I want to place an image in my program, aslike picture box or image in VB/VC. But I have not found any examples or references yet. The sources of uppsrc are very complicated. Could you suggest a bit...
Re: Help-Iml Drawing [message #1456 is a reply to message #1455] Sat, 04 March 2006 20:23 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
mechatronic wrote on Sat, 04 March 2006 12:00

Hhm, sorry. Very Happy I knew it was very ambiguous. I will pay attention to tittle.
To luzr: It's simple I want to place an image in my program, aslike picture box or image in VB/VC. But I have not found any examples or references yet. The sources of uppsrc are very complicated. Could you suggest a bit...


Is reference/iml what you are looking for?

Mirei
Previous Topic: where is the ImageDraw::DrawPixel ?
Next Topic: Showing bitmaps or Icons
Goto Forum:
  


Current Time: Sat Apr 20 10:47:02 CEST 2024

Total time taken to generate the page: 0.02822 seconds