#include <WScom.h>
#include <WSCfunctionList.h>
#include <WSCbase.h>
//----------------------------------------------------------
//Function for the event procedure
//----------------------------------------------------------
#include <WSCvdrawingArea.h>
#include <WSCvslider.h>
double scale;

void drawep(WSCbase* object){
  //drawing_a is same as newvdra_000...
  //You can get it extern WSCvdrawingArea* newvdra000; also.
  WSCvdrawingArea* drawing_a =(WSCvdrawingArea*)object->cast("WSCvdrawingArea");
  if (drawing_a == NULL){
    return;
  }

  WSCulong w = drawing_a->getProperty(WSNwidth);
  WSCulong h = drawing_a->getProperty(WSNheight);
  long scale1 = (long)drawing_a->getUserData("scale value");
  long pos = (long)drawing_a->getUserData("pos value");

  if (scale1 == 0){
    scale1 = 100;
  }
  scale = (double)scale1 / 100;
  
  drawing_a->setScaleOffsetPtr(&scale);

  drawing_a->drawStretchedImage(pos,pos,w,h,"001.jpg");



}
static WSCfunctionRegister  op("drawep",(void*)drawep);
