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 » PNG to IML?
Re: PNG to IML? [message #9324 is a reply to message #9320] Fri, 27 April 2007 09:16 Go to previous message
mirek is currently offline  mirek
Messages: 13979
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
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: from window to image
Next Topic: DrawImage scaling
Goto Forum:
  


Current Time: Mon May 13 09:40:14 CEST 2024

Total time taken to generate the page: 0.03127 seconds