Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » PNG to IML?
PNG to IML? [message #9299] |
Thu, 26 April 2007 02:03 |
adkiller
Messages: 25 Registered: November 2005
|
Promising Member |
|
|
Hi,
How do I import a PNG file into IML? I have an existing PNG file that I would like to use as IML resource. I tried copying and pasting but the alpha data is always lost. IML Designer supports alpha image editing but doesn't seem to support pasting such data from an image editing program.
Any way I can convert PNG files into *.iml?
I am using U++ 2007.1
Thanks,
-Ad
[Updated on: Thu, 26 April 2007 02:04] Report message to a moderator
|
|
|
|
|
|
|
Re: PNG to IML? [message #9324 is a reply to message #9320] |
Fri, 27 April 2007 09:16 |
|
mirek
Messages: 13975 Registered: November 2005
|
Ultimate Member |
|
|
As I see this problem troubles you:
IconDes/List.cpp
FileSel& IconDes::ImgFile()
{
static FileSel sel;
ONCELOCK {
sel.Type("Image files", "*.png *.bmp *.jpg *.jpeg *.gif");
sel.AllFilesType();
}
return sel;
}
void IconDes::InsertFile()
{
if(!ImgFile().ExecuteOpen()) return;
Image m = StreamRaster::LoadFileAny(~ImgFile());
if(IsNull(m)) {
Exclamation("Not an image.");
return;
}
ImageInsert("", m);
EditImage();
}
void IconDes::ListMenu(Bar& bar)
{
bar.Add("Insert image..", IconDesImg::Insert(), THISBACK(InsertImage))
.Key(K_INSERT);
bar.Add(IsCurrent(), "Image..", IconDesImg::Edit(), THISBACK(EditImage));
bar.Add(IsCurrent(), "Remove image", IconDesImg::Remove(), THISBACK(RemoveImage));
bar.Add(IsCurrent(), "Duplicate", IconDesImg::Duplicate(), THISBACK(Duplicate))
.Key(K_CTRL_D);
bar.Add("Insert from clipboard", IconDesImg::InsertPaste(), THISBACK(InsertPaste))
.Key(K_ALT_V);
bar.Add("Insert from file", IconDesImg::InsertFile(), THISBACK(InsertFile))
.Key(K_ALT_O);
bar.Separator();
bar.Add(IsCurrent() && list.GetCursor() > 0, "Move up", IconDesImg::MoveUp(),
THISBACK1(MoveSlot, -1))
.Key(K_ALT|K_CTRL_UP);
bar.Add(IsCurrent() && list.GetCursor() < slot.GetCount() - 1, "Move down", IconDesImg::MoveDown(),
THISBACK1(MoveSlot, 1))
.Key(K_ALT|K_CTRL_DOWN);
if(removed.GetCount()) {
bar.Separator();
for(int i = removed.GetCount() - 1; i >= 0; i--) {
Slot& r = removed[i];
bar.Add("Insert " + sFormatImageName(r.name, r.image, r.exp), r.base_image,
THISBACK1(InsertRemoved, i));
}
}
}
(Add ImgFile and InsertFile declarations to class too...)
Mirek
|
|
|
Goto Forum:
Current Time: Fri May 03 03:22:19 CEST 2024
Total time taken to generate the page: 0.03886 seconds
|