Wide Studio Object Reference

Wide Studio Home
Up to


Class Name

WSDdev

Specification of methods



setScalePtr Function Description

Form
void setScalePtr(double* ptr)
Function
Set a pointer to a valiable stored a magnify rate.
Description
When a pointer is set to a valiable that stored a magnify reate, it draws with its magnify rate.
Parameters
(in)double* ptr A pointer to a valiable to a magniy rate
Return value
None
Notice
Set NULL when the setting is canceled
Samples
  dev->setScalePtr(&scale);//Pass a double type scale pointer



setXOffsetPtr Function Description

Form
void setXOffset(short* ptr)
Function
Set a pointer to a valiable that stored X offset of displaying position X
Description
Draw on the coordinate adding offset value when a pointer is set to the valiable that has X offset of displaying position.
Parameters
(in)short* ptr Pointer to a valiable of offset value
Return value
None
Notice
Set NULL when the setting is canceled
Samples
  dev->setXOffsetPtr(&xoffset);//Pass a short type xoffset pointer



setYOffsetPtr Function Description

Form
void setYOffset(short* ptr)
Function
Specify a pointer to a valiable that stored Y offset of displaying position Y
Description
Draw on the coordinate adding offset value when a pointer is set to the valiable that has Y offset of displaying position
Parameters
(in)short* ptr Pointer to a valiable of offset value
Return value
None
Notice
Set NULL when the setting is canceled
Samples
  dev->setYOffsetPtr(&yoffset);//Pass a short type yoffset pointer



getScale Function Description

Form
double getScale()
Function
Obtain a magnify rate
Description
If a pointer is set to the valiable that stored a magnify rate, this returns its value, otherwise 1 is returned.
Parameters
None
Return value
Displaying magnify rate
Notice
None
Samples
  //WSDdev Obtain a scale offset set in a instance
  double scale = dev->getScale();



getXOffset Function Description

Form
short getXOffset()
Function
Display position X offset
Description
If a poiter is set to the valiable that stored a display position X offset, this returns its value, otherwise 0 is returned.
Parameters
None
Return value
Display position X offset
Notice
None
Samples
  //Obtain X offset set in the WSDdev instance
  short xoffset = dev->getXOffset();



getYOffset Function Description

Form
short getYOffset()
Function
Display position Y offset
Description
If a poiter is set to the valiable that stored a display position Y offset, this returns its value, otherwise 0 is returned.
Parameters
None
Return value
Display position Y offset
Notice
None
Samples
  //Obtain Y offset set in the WSDdev instance
  short yoffset = dev->getYOffset();



setForeColor Function Description

Form
long setForeColor(short cno)
Function
Specify drawing color by the color number
Description
Specify drawing color used in methods like drawLine etc.
Parameters
(in)short cno Color number
Return value
WS_NO_ERR:Success, WS_ERR:Fail
Notice
Samples
//WSCvline::draw() example
long WSCvline::draw(){
  if (getVisible() == False){
    return WS_NO_ERR;
  }
  WSDdev* dev = getowndev();
  if (dev == NULL){
    return WS_ERR;
  }
  short x = _x;
  short y = _y;
  WSCushort w = _w;
  WSCushort h = _h;

  WSCbool absolute = getAbsoluteDraw();
  if (absolute == True){
  }else
  if (dev->isExposed(x, y, w, h) == False){
    return WS_NO_ERR;
  }
  WSCbool blinkfore = WSGIappBlink()->getBlinkFore(_blink_rate);
  if (_bl_fl == True &&
      blinkfore == True &&
      _tw_fl == False){
    return WS_NO_ERR;
  }

  long err = dev->beginDraw(x, y, w, h, absolute);
  if (err != WS_NO_ERR){
    return WS_NO_ERR;
  }

  WSCbase::update();
  setAbsoluteDraw(False);
  WSCushort line_w = _lw;
  if (line_w != 0) {
    if (_bl_fl == True &&
        blinkfore == True &&
        _tw_fl == True){
      dev->setForeColor(_blink_color);
    } else {
      dev->setForeColor(_fore_color);
    }

    if (line_w == 1) {
      dev->setLineWidth((WSCushort)0);
    } else {
      dev->setLineWidth((WSCushort)line_w);
    }
    dev->setLineDashType(_lt);
    if (_line_num != 0) {
      WSCpoint* pt = new WSCpoint[_line_num];
      short     i;
      for (i=0; i<_line_num; i++) {
        pt[i].x = (short)(_line_x[i]);
        pt[i].y = (short)(_line_y[i]);
      }
      dev->drawLines(pt, _line_num);
      delete pt;
    }
  }
  dev->endDraw();
  return WS_NO_ERR;
}



setBackColor Function Description

Form
long setBacKColor(short cno)
Function
Specify a background color by the color number
Description
Specify a background color used in like drawFillRect method etc.
Parameters
(in)short cno Color number
Return value
WS_NO_ERR:Success, WS_ERR:Fail
Notice
Samples
  //Specify a background color
  short cno = WSGIappColorSet()->getColorNo("#000000");
  dev->setBackColor(cno);



setLineWidth Function Description

Form
long setLineWidth(short linewidth)
Function
Specify a line girth to draw
Description
Specify a line girth used in drawLine etc.
Parameters
(in)short linewidth Line girth
Return value
WS_NO_ERR:Success,WS_ERR:Fail
Notice
None
Samples
Refer to setForeColor()



setLineDashType Function Description

Form
long setLineDashType(char no)
Function
Specify dotted line attribute to a drawing line
Description
Specify dotted line attribute used in drawLine etc.
Parameters
(in)char no Dotted line attribute

The follwing is supported for the dotted line attribute
Attribute value Meaning
0 Solid line
1 Chain line
2 Long chain line
3 Single dash line
4 Double dash line
5 Long single dash line
6 Long double dash line
7 Fine dotted line
Return value
WS_NO_ERR:Sucess, WS_ERR:Fail
Notice
Samples
Refer to setForeColor()



setHatchPattern Function Description

Form
long setHatchPattern(char no)
Function
Specify daub attribute
Description
Specify daub attribute used in drawRect method etc.
Parameters
(in)char no Daub attribute

The followings are supported as daub attribute.
Attribute value Meaning
0 Sold
1 Left down hatched
2 Right down hatched
3 Vertical line
4 Horizontal line
5 Plagi-cross
6 Check pattern
7 Dots
Return value
WS_NO_ERR:Success, WS_ERR:Fail
Notice
None
Samples
  //Set hatch pattern
  dev->setHatchPattern(7);



setRegion Function Description

Form
long setRegion(short x,short y,unsigned short w,unsigned short h);
Function
Specify a drawing area
Description
Outside of a specified area is not drawn
Parameters
(in)short x X coordinate
(in)short y Y coordinate
(in)unsigned short w Area width
(in)unsigned short h Area height
Return value
WS_NO_ERR:Success, WS_ERR:Fail
Notice
None
Samples
  //Specify a drawing area
  dev->setRegion(10,10,100,100);



beginDraw Function Description

Form
long beginDraw(short x,short y,WSCushort w,WSCushort h, WSCbool absolute = False,WSCbool scaling = True)
Function
Start drawing on a specified area
Description
Start drawing of rectangle region coordinate x,y, width w, and height h When absolute is set True, it draws even if an exposure event is not araisen Also, when scaling is set True, it draws with scale offset effective.
Parameters
(in)short x X coordinate
(in)short y Y coordinate
(in)unsigned short w Region width
(in)unsigned short h Region height
(in)WSCbool absolute Force drawing flag
(in)WSCbool scaling Scale flag
Return value
WS_NO_ERR:Success, WS_ERR:Fail
Notice
None
Samples
Refer to setForeColor()



drawArc Function Description

Form
long drawArc(short x,short y,unsigned short w, unsigned short h,short a1,short a2);
Function
Draw circular arc, orval arc
Description
Specify arc start degree, arc end degree with X right cooridinate being 0 degree by anticlockwise of a circle/orval with horizontal diameter w, and vertical diameter h. Where, note that you should specify the value with 64fold. This is to assure 1/64 accuracy. When drawing a complete circle, an orval, or an arc, specify 0*64, 360*64 for each.
Parameters
(in)short x X coordinate
(in)short y Y coordinate
(in)unsigned short w Region width
(in)unsigned short h Region height
(in)short a1 Arc start degree
(in)short a2 Arc end degree
Return value
WS_NO_ERR:Success, WS_ERR:Fail
Notice
None
Samples
  //Draw a circlar arc 
  dev->drawArc(50,200,50,50,60*64,270*64);



drawFillArc Function Description

Form
long drawFillArc(short x,short y,unsigned short w, unsigned short h,short a1,short a2,char kind);
Function
Draw a daub fill arc/oval arc
Description
Specify arc start degree, arc end degree with X right cooridinate being 0 degree by anticlockwise of a circle/orval with horizontal diameter w, and vertical diameter h. Where, note that you should specify the value with 64fold. This is to assure 1/64 accuracy. When drawing a complete circle, an orval, or an arc, specify 0*64, 360*64 for each. Specifying a kinds of arc, you can draw a sector form arc or arch arc.
Parameters
(in)short x X coordinate
(in)short y Y coordinate
(in)unsigned short w Region width
(in)unsigned short h Region height
(in)short a1 Arc start degree
(in)short a2 Arc end degree
(in)char kind Kinds of a daub fill arc
Following daub fills arc are supported.
Attribute Meaning
0 Sector form
1 Arch form
Return value
WS_NO_ERR:Success, WS_ERR:Fail
Notice
None
Samples
  //Draw a pie form arc
  dev->drawFillArc(150,200,100,50,60*64,270*64, 0 /*PIE*/ );
  //Draw a chord form arc
  dev->drawFillArc(250,200,100,50,60*64,270*64, 1 /*CHORD*/ );



drawLine Function Description

Form
long drawLine(short x1,short y1,short x2,short y2);
Function
Draw a line
Description
Draw a line from coordinate (x1,y1) to (x2,y2)
Parameters
(in)short x1 Line start X coordinate
(in)short y1 Line start Y coordinate
(in)short x2 Line end X coordinate
(in)short y2 Line end Y coordinate
Return value
WS_NO_ERR:Success, WS_ERR:Fail
Notice
None
Samples
  //Draw a line
  dev->drawLine(50,50,100,100);



drawLines Function Description

Form
long drawLines(WSCpoint* pt,long num);
Function
Draw a polygonal line
Description
Draw a polygonal line starting with specified (X1,Y1) through (Xn,Yn)
Parameters
(in)WSCpoint* pt Array of corner points
(in)long num The number of corner points

WSCpoint has members x,y
Return value
WS_NO_ERR:Success, WS_ERR:Fail
Notice
None
Samples
Refer to setForeColor()



drawRect Function Description

Form
long drawRect(short x,short y,unsigned short w,unsigned short h);
Function
Draw a rectagle
Description
Draw a rectagle of (x,y) on its upper left with a width w, height h
Parameters
(in)short x X coordinate
(in)short y Y coordinate
(in)unsigned short w Rectagle width
(in)unsigned short h Rectagle height
Return value
WS_NO_ERR:Success, WS_ERR:Fail
Notice
None
Samples
  //Draw a rectagle
  dev->drawRect(150,50,100,100);



drawFillRect Function Description

Form
long drawFillRect(short x,short y,unsigned short w,unsigned short h);
Function
Draw a daub fill rectagle
Description
Draw a daub fill rectagle of (x,y) on its upper left, with a width w, height h
Parameters
(in)short x X coordinate
(in)short y Y coordinate
(in)unsigned short w Rectagle width
(in)unsigned short h Rectagle height
Return value
WS_NO_ERR:Success,WS_ERR:Fail
Notice
None
Samples
  //Draw a daub fill rectagle
  dev->drawFillRect(150,50,100,100);



drawRects Function Description

Form
long drawRects(WSCrect* pt,long num);
Function
Draw a multiple ractalges
Description
Draw a multiple ractalges specified by WSCrect array
Parameters
(in)WSCrect* rect Rectagle array
(in)long num The number Rectagles

WSCrect has members x,y,width,height
Return value
WS_NO_ERR:Success, WS_ERR:Fail
Notice
None
Samples
  //Draw a rectagle
  WSCrect rect[3];
  rect[0].setRect(300,300,10,10);
  rect[1].setRect(320,300,10,10);
  rect[2].setRect(340,300,10,10);
  dev->drawRects(rect,3);



drawFillRects Function Description

Form
long drawFillRects(WSCrect* pt,long num);
Function
Draw multiple daub fill rectagles
Description
Draw multiple daub fill rectagles specified by WSCrect array
Parameters
(in)WSCrect* rect Rectagle array
(in)long num The number of corner points

WSCrect has members x,y,width,height
Return value
WS_NO_ERR:Succuess, WS_ERR:Fail
Notice
None
  //Draw a rectagle
  WSCrect rect[3];
  rect[0].setRect(300,300,10,10);
  rect[1].setRect(320,300,10,10);
  rect[2].setRect(340,300,10,10);
  dev->drawFillRects(rect,3);



drawPoly Function Description

Form
long drawPoly(WSCpoint* pt,long num);
Function
Draw a polygon
Description
Draw a polygon of connecting specified the coordinate(X1,Y1) through (Xn,Yn)
Parameters
(in)WSCpoint* pt Coner points coordinates array
(in)long num The number of corner points

WSCpoint has members x,y
Return value
WS_NO_ERR:Succuess, WS_ERR:Fail
Notice
None
Samples
  WSCpoint pt[3];
  pt[0].x = 300;
  pt[0].y = 300;
  pt[1].x = 330;
  pt[1].y = 330;
  pt[2].x = 300;
  pt[2].y = 330;
  dev->setForeColor("#00ffff");
  dev->drawPoly(pt,3);



drawFillPoly Function Description

Form
long drawFillPoly(WSCpoint* pt,long num);
Function
Draw a daub fill polygon
Description
Draw a daub fill polygon connecting specified coordinate (X1,Y1) through (Xn,Yn)
Parameters
(in)WSCpoint* pt Coner points coordinates array
(in)long num The number of corner points

WSCpoint has member x,y
Return value
WS_NO_ERR:Succuess, WS_ERR:Fail
Notice
None
Samples
  WSCpoint pt[3];
  pt[0].x = 300;
  pt[0].y = 300;
  pt[1].x = 330;
  pt[1].y = 330;
  pt[2].x = 300;
  pt[2].y = 330;
  dev->setForeColor("#00ffff");
  dev->drawFillPoly(pt,3);



drawGradation Function Description

Form
long drawGradation(long type,short col1,short col2, short col3,short x,short y,WSCushort w,WSCushort h, WSCuchar grad_margin);
Function
Draw a gradation rectagle
Description
Draw a gradation rectagle using three colors to transition from color 1 through color 2 to color 3
Parameters
(in)long type Gradation kinds
(in)short col1 Color 1
(in)short col2 Color 2
(in)short col3 Color 3
(in)short x Coordinate X
(in)short y Coordinate Y
(in)WSCushort w Width
(in)WSCushort h Height
(in)WSCuchar grad_margin Color 2 width

Specify a gradated rectagle region and width of two colors in dots as a margin of gradation. The following values are supported for gradation kinds
Gradation kinds Meaning
WS_GR_LT_RB Upper left to lower right
WS_GR_RT_LB Upper right to lower right
WS_GR_LB_RT Lower left to upper right
WS_GR_RB_LT Lower right to upper left
WS_GR_T_B Top to bottom
WS_GR_B_T Bottom to top
WS_GR_L_R Left to right
WS_GR_R_L Right to left
Return value
WS_NO_ERR:Succuess, WS_ERR:Fail
Notice
None
Samples
  short cno1 = WSGIappColorSet()->getColorNo("#888888");
  short cno2 = WSGIappColorSet()->getColorNo("#aaaaaa");
  short cno3 = WSGIappColorSet()->getColorNo("#000000");
  dev->drawGradation(WS_GR_T_B,cno1,cno2,cno3,10,10,100,50,10);



drawImage Function Description

Form
long drawImage(short x,short y,WSCushort w,WSCushort h, WSDimage* img,char align);
Function
Display an image
Description
Draw a specified image structure within a specified rectagle area
Parameters
(in)short x X coordinate
(in)short y Y coordinate
(in)WSCushort w Width
(in)WSCushort h Height
(in)WSDimage* img Image to display
(in)char align Alignment

The following alignment values are supported
Attribute Meaning
WS_LEFT Left adjust
WS_RIGHT Right adjust
WS_CENTER Center adjust
WS_TOP Top adjust
WS_BOTTOM Bottom adjust
WS_LEFT_TOP Upper left adjust
WS_LEFT_BOTTOM Lower left adjust
WS_RIGHT_BOTTOM Lower rihgt adjust
WS_RIGHT_TOP Upper right adjust
Return value
WS_NO_ERR:Succuess, WS_ERR:Fail
Notice
None
Samples
  WSCimage* image = WSGIappImageSet()->getImage("001.jpg");
  dev->drawImage(10,10,100,100,image,WS_CENTER);



drawStretchedImage Function Description

Form
long drawStretchedImage(short x,short y, WSCushort w,WSCushort h, WSDimage* img);
Function
Display a stretched image.
Description
Draw a specified stretched image structure within a specified rectagle area
Parameters
(in)short x X coordinate
(in)short x Y coordinate
(in)WSCushort w Width
(in)WSCushort h Height
(in)WSDimage* img Image to display

Return value
WS_NO_ERR:Succuess, WS_ERR:Fail
Notice
None
Samples
  WSCimage* image = WSGIappImageSet()->getImage("001.jpg");
  dev->drawStretchedImage(10,10,100,100,image);



drawString Function Description

Form
long drawString(short x,short y,WSCushort w,WSCushort h, char font_no,char align,char* string, long encoding = WS_EN_DEFAULT);
Function
Display specified strings within a specified rectagle area
Description
Display specified strings following an encoding within a specified recatagle area
Parameters
(in)short x X coordinate
(in)short x Y coordinate
(in)WSCushort w Width
(in)WSCushort h Height
(in)char font_no Font number
(in)char align Alignment
(in)char* string Strings to display
(in)long encoding Strings' encoding

Font number is a number starting from 0 The following alignment values are supported
Attribute Meaning
WS_LEFT Left adjust
WS_RIGHT Right adjust
WS_CENTER Center adjust
WS_TOP Top adjust
WS_BOTTOM Bottom adjust
WS_LEFT_TOP Upper left adjust
WS_LEFT_BOTTOM Lower left adjust
WS_RIGHT_BOTTOM Lower rihgt adjust
WS_RIGHT_TOP Upper right adjust

The following values are supported for encoding. Default value is WS_EN_DEFAULT
Attribute Meaning
WS_EN_DEFAULT Specify current settings (The default value)
WS_EN_LOCALE Specify current LANG environment valiable setting
WS_EN_NONE Do not set
WS_EN_ISO8859_1 Specify ISO8859(1)
WS_EN_ISO8859_2 Specify ISO8859(2)
WS_EN_ISO8859_3 Specify ISO8859(3)
WS_EN_ISO8859_4 Specify ISO8859(4)
WS_EN_ISO8859_5 Specify ISO8859(5)
WS_EN_ISO8859_6 Specify ISO8859(6)
WS_EN_ISO8859_7 Specify ISO8859(7)
WS_EN_ISO8859_8 Specify ISO8859(8)
WS_EN_ISO8859_9 Specify ISO8859(9)
WS_EN_ISO8859_10 Specify ISO8859(10)
WS_EN_ISO8859_11 Specify ISO8859(11)
WS_EN_ISO8859_12 Specify ISO8859(12)
WS_EN_ISO8859_13 Specify ISO8859(13)
WS_EN_ISO8859_14 Specify ISO8859(14)
WS_EN_ISO8859_15 Specify ISO8859(15)
WS_EN_UTF8 Specify UTF8
WS_EN_KOI8R Specify KOI8R
WS_EN_EUCJP Specify EUCJP
WS_EN_SJIS Specify SJIS
WS_EN_EUCKR Specify EUCKR
WS_EN_EUCCN Specify EUCCN
WS_EN_BIG5 Specify BIG5
Return value
WS_NO_ERR:Succuess, WS_ERR:Fail
Notice
None
Samples
  //Draw a string..
  dev->drawString(100,300,100,30,0,WS_CENTER,"ABCDE1234");



drawFillString Function Description

Form
long drawFillString(short x,short y,WSCushort w,WSCushort h, char font_no,char align,char* string, long encoding = WS_EN_DEFAULT);
Function
Display a specified strings with background color within a rectagle area
Description
Display a specified strings following encoding within a specified rectagle area
Parameters
(in)short x X coordinate
(in)short x Y coordinate
(in)WSCushort w Width
(in)WSCushort h Height
(in)char font_no Font number
(in)char align Alignment
(in)char* string Strings to show
(in)long encoding Strings' encoding

For the argument details, please refer to drawString item.
Return value
WS_NO_ERR:Succuess, WS_ERR:Fail
Notice
None
Samples
  //Draw a string with back ground.
  dev->drawFillString(100,300,100,30,0,WS_CENTER,"ABCDE1234");



getDeviceResource Function Description

Form
long getDeviceResource()
Function
Obtain window system resources
Description
Parameters
None
Return value
For X11, it returns Display*. For WIN32, it is not used.
Notice
None
Samples
  //Display* for X11
  long val = dev->getDeviceResource();



getWindowResource Function Description

Form
long getWindowResource()
Function
Obtain window resources
Description
Parameters
None
Return value
Fro X11, it returns Window or Pixmap, For WIN32, HWND
Notice
None
Samples
  //For X11, Window/Pixmap, For WIN32, HWND is returned
  long val = dev->getWindowResource();



getContextResource Function Description

Form
long getContextResource()
Function
Obtain context resources
Description
Parameters
None
Return value
For X11, it returns GC. For WIN32, it returns HDC or MDC
Notice
None
Samples
  //For X11, GC, For WIN32, HDC/MDC is returned
  long val = dev->getContextResource();



getSpecialResource Function Description

Form
long getSpecialResource()
Function
Obtain window resources
Description
Parameters
None
Return value
For X11, it returns Widget. For WIN32, it is not used.
Notice
None
Samples
  //For X11, Widget is returned
  long val = dev->getSpecialResource();



getReady Function Description

Form
long getReady()
Function
Check whether drawable or not
Description
Parameters
None
Return value
True = Drawable, False = Undrawable
Notice
None
Samples
  //Check whether drawable or not
  WSCbool ready = dev->getReady();


Document Release 3.0

For Use with Wide Studio Release 3.0, Summer 2002


Wide Stuido Home | Up to

Copyright(C) T. Hirabayashi, 1999-2002 Last modified: July 15, 2002