这个Component为何出错
这个Component为何
在ActiveBitmap 装入一bmp出错何出错?应怎么改?
//---------------------------------------------------------------------------
#ifndef CoolBtnH
#define CoolBtnH
//---------------------------------------------------------------------------
#include <SysUtils.hpp>
#include <Controls.hpp>
#include <Classes.hpp>
#include <Forms.hpp>
#include <ExtCtrls.hpp>
#include <graphics.hpp>
//---------------------------------------------------------------------------
class PACKAGE TCoolBtn : public TPanel
{
private:
Graphics::TBitmap *shwBitmap;
Graphics::TBitmap *atvBitmap;
Graphics::TBitmap *psdBitmap;
TImage *img;
TTimer *tmr;
protected:
public:
__fastcall TCoolBtn(TComponent* Owner);
__published:
void __fastcall TimerProc(TObject *Sender);
__property Graphics::TBitmap *ShowBitmap={read=shwBitmap,write=shwBitmap,default=NULL};
__property Graphics::TBitmap *ActiveBitmap={read=atvBitmap,write=atvBitmap,default=NULL};
__property Graphics::TBitmap *PushedBitmap={read=psdBitmap,write=psdBitmap,default=NULL};
};
//---------------------------------------------------------------------------
#endif
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "CoolBtn.h"
#pragma package(smart_init)
//---------------------------------------------------------------------------
// ValidCtrCheck is used to assure that the components created do not have
// any pure virtual functions.
//
static inline void ValidCtrCheck(TCoolBtn *)
{
new TCoolBtn(NULL);
}
//---------------------------------------------------------------------------
void __fastcall TCoolBtn::TimerProc(TObject *Sender)
{
//
}
//---------------------------------------------------------------------------
__fastcall TCoolBtn::TCoolBtn(TComponent* Owner)
: TPanel(Owner)
{
Caption="";
BevelOuter=bvNone;
tmr=new TTimer(Owner);
tmr->Enabled=false;
tmr->Interval=200;
tmr->OnTimer=TimerProc;
img=new TImage(Owner);
img->Align=alClient;
img->Stretch=true;
}
//---------------------------------------------------------------------------
namespace Coolbtn
{
void __fastcall PACKAGE Register()
{
TComponentClass classes[1] = {__classid(TCoolBtn)};
RegisterComponents("Samples", classes, 0);
}
}
//---------------------------------------------------------------------------
问题点数:0、回复次数:3Top
1 楼COKING(天晴)回复于 2003-09-04 15:45:01 得分 0
img=new TImage(Owner);
img->Align=alClient;
img->Stretch=true;
shwBitmap=new Graphics::TBitmap();
atvBitmap=new Graphics::TBitmap();
psdBitmap=new Graphics::TBitmap();Top
2 楼litth(慕容飞云)回复于 2003-09-04 15:51:41 得分 0
还是不行的Top
3 楼aliker(吹口琴的猫)回复于 2003-09-22 13:33:03 得分 0
关注Top



