THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 27/04/2010 at 08:02, xxxxxxxx wrote:
I am not able to confirm the problem.
Here is my test code, it'a simple dialog with a scalable bitmap user area.
// be sure to use a unique ID obtained from www.plugincafe.com
var PLUGIN_ID = 910000;
// be sure to use a unique ID obtained from www.plugincafe.com
// global variables
var bmp;
var text;
// definition of my user area
class MyUserArea : GeUserArea
{
public:
MyUserArea(id,dialog);
Init();
GetUserWidth();
GetUserHeight();
Draw(x1,y1,x2,y2);
}
MyUserArea::MyUserArea(id,dialog)
{
super(id,dialog);
}
MyUserArea::Init()
{
}
MyUserArea::GetUserWidth()
{
return 128;
}
MyUserArea::GetUserHeight()
{
return 128;
}
MyUserArea::Draw(x1,y1,x2,y2)
{
OffScreenOn();
SetClippingRegion(x1,y1,x2,y2);
DrawBitmap(bmp, 0, 0, 127, 127, x1, y1, x2, y2, BMP_NORMALSCALED);
}
// definition of my Dialog class
class MyDialog : GeDialog
{
private:
var ua;
public:
MyDialog();
CreateLayout();
Init();
Command(id,msg);
}
MyDialog::MyDialog()
{
super(PLUGIN_ID);
ua=NULL;
}
MyDialog::CreateLayout()
{
SetTitle("My Dialog");
AddUserArea(5000,BFH_SCALEFIT|BFV_SCALEFIT,0,0);
ua = new(MyUserArea,5000,this);
return TRUE;
}
MyDialog::Init()
{
}
MyDialog::Command(id,msg)
{
// switch (id)
{
}
}
class MyMenuPlugin : MenuPlugin
{
public:
MyMenuPlugin();
GetID();
GetName();
GetHelp();
Execute(doc);
RestoreLayout(secret,subid);
}
MyMenuPlugin::MyMenuPlugin()
{
super();
}
MyMenuPlugin::GetID()
{
return PLUGIN_ID;
}
MyMenuPlugin::GetName()
{
return "My Dialog";
}
MyMenuPlugin::GetHelp()
{
return "Shows programming of bitmap area";
}
var d;
MyMenuPlugin::Execute(doc)
{
d->Open(TRUE,-1,-1);
}
MyMenuPlugin::RestoreLayout(secret,subid)
{
if (!d) d = new(MyDialog);
d->RestoreLayout(secret);
}
main()
{
d = new(MyDialog);
if (!bmp) bmp = new(BaseBitmap, 128, 128);
var fn = new(Filename);
fn->SetFullString("c:\\testbitmap.tif");
bmp->Load(fn);
Register(MyMenuPlugin);
}
cheers,
Matthias