This snippet has pretty much everything you are after I think.
If you have questions, just ask...
Code:
#include <acknex.h>
#include <default.c>


PANEL* mainpan =
{
	layer = -10;
	pos_x = 350;  pos_y = 175;
	bmap = "test_img.bmp";
	flags = SHOW;
}


typedef struct 
{
	STRING* name;
	BMAP* bitmap;
}PANELMAP;


PANELMAP mypanmap;



function main()
{
	sky_color.red   = 0;
	sky_color.green = 0;
	sky_color.blue  = 0;
	level_load(NULL);

	wait(3);
	
	vec_set(camera.x, vector(200,-20,50));
	vec_set(camera.pan, vector(175,-20,0));
	ent_create("cube.mdl", nullvector,NULL);

	wait(3);	
	
	mypanmap.name = str_create( mainpan->bmap->link.name );
	(mypanmap.name->chars)[str_len(mypanmap.name)-4] = 46;
	
	mypanmap.bitmap = mainpan.bmap;
	
	
	error(mypanmap.name);

}




"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial