Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » Showing bitmaps or Icons
Re: Showing bitmaps or Icons [message #1813 is a reply to message #1806] |
Mon, 20 March 2006 14:27 |
|
fudadmin
Messages: 1321 Registered: November 2005 Location: Kaunas, Lithuania
|
Ultimate Contributor Administrator |
|
|
luzr wrote on Mon, 20 March 2006 08:12 |
fudadmin wrote on Mon, 20 March 2006 01:45 | Why this doesn't work?
#include <CtrlLib/CtrlLib.h>
GUI_APP_MAIN
{ TopWindow w;
Label l;
Image img;
w.Add(l);
l.SetPos(l.PosLeft(0, 100), l.PosTop(0, 30));
img = BmpEncoder::NewBmp()->LoadImage("testImg.bmp");
//img.Exclamation(); //at least this should work?
l.SetImage(img);
w.Run();
}
And how to check if image was loaded?
|
Are you sure that path is correct? (Well, there is no path, so it likely is not).
If it was not loaded, result will be empty (e.g. GetSize() == Size(0, 0))
Mirek
|
Are you sure that you know Ultimate++?...
The image loading works this way:
GUI_APP_MAIN
{
TopWindow w;
Label l1,l2;
Image img1,img2;
w.Add(l1);
l1.SetPos(l1.PosLeft(10, 100), l1.PosTop(10, 30));
img1= PngEncoder::New()->LoadImageFile("testImg.png");
l1.SetImage(img1);
w.Add(l2);
img2 = BmpEncoder::NewBmp()->LoadImageFile("testImg.bmp");
l2.SetImage(img2);
l2.SetPos(l2.PosLeft(150, 100), l2.PosTop(10, 30));
w.Run();
}
[Updated on: Mon, 20 March 2006 14:28] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Fri May 17 20:04:12 CEST 2024
Total time taken to generate the page: 0.02318 seconds
|