Beispiel #1
0
 void GdiContext2D::restore()
 {
     Check();
     // pop state stack and restore state
     CanvasStateInfo* p = m_stack.back();
     m_stack.pop_back();
     p->m_SaveClipRgn.Restore();
     // push state on state stack
     //The current transformation matrix.
     //The current clipping region.
     //The current values of the following attributes:
     set_strokeStyle(p->strokeStyle);
     set_fillStyle(p->fillStyle);
     //globalAlpha,
     lineWidth = p->lineWidth;
     //lineCap,
     //lineJoin,
     //miterLimit,
     set_shadowOffsetX(p->shadowOffsetX);
     set_shadowOffsetY(p->shadowOffsetY);
     set_shadowBlur(p->shadowBlur);
     set_shadowColor(p->shadowColor);
     //globalCompositeOperation,
     set_font(p->font);
     set_textAlign(p->textAlign);
     set_textBaseline(p->textBaseline);
     delete p;
 }
Beispiel #2
0
 //
 ///////////////////////////////////////////////////////////////////////////
 // The clearRect(x, y, w, h) method must clear the pixels in the specified
 // rectangle that also intersect the current clipping region to a fully transparent
 // black, erasing any previous image. If either height or width are zero,
 // this method has no effect.
 void GdiContext2D::clearRect(double x, double y, double w, double h)
 {
     FillStyle fs = fillStyle;
     fillStyle = Color("#FFFFFF"); //GDI background color white? black?
     //
     fillRect(x, y, w, h);
     //
     set_fillStyle(fs);
 }
Beispiel #3
0
int
GIFsetGraphAttr(Metafile *mf, int num, Gint code, Gint attr)
{
  int		imf;
  mf_cgmo		**cgmo	= &mf->cgmo;
  for (imf = 0; imf < num; ++imf) {
    GIFmetafile *meta = find_meta(cgmo[imf]);
    assert(meta);
    switch(code){
    case GKSM_POLYLINE_INDEX:
      set_lineColor(meta, attr, GBUNDLED);
      set_lineWidth(meta, 0.0, attr, GBUNDLED);
      set_lineStyle(meta, attr, GBUNDLED);
      break;
    case GKSM_POLYLINE_COLOUR_INDEX:
      set_lineColor(meta, attr, GINDIVIDUAL);
      break;
    case GKSM_LINETYPE:
      set_lineStyle(meta, attr, GINDIVIDUAL);
      break;
    case GKSM_TEXT_COLOUR_INDEX:
      unsupported("GIFsetGraphAttr : GKSM_TEXT_COLOUR_INDEX", attr);
      break;
    case GKSM_FILL_AREA_COLOUR_INDEX:
      set_fillColor(meta, attr);
      break;
    case GKSM_FILL_AREA_STYLE_INDEX:
      set_fillStyle(meta, attr);
      break;
    case GKSM_POLYMARKER_COLOUR_INDEX:
      unsupported("GIFsetGraphAttr : GKSM_POLYMARKER_COLOUR_INDEX", attr);
      break;
    case GKSM_FILL_AREA_INDEX:
      unsupported("GIFsetGraphAttr : GKSM_FILL_AREA_INDEX", attr);
      break;
    case GKSM_MARKER_TYPE:
      unsupported("GIFsetGraphAttr : GKSM_MARKER_TYPE", attr);
      break;
    case GKSM_POLYMARKER_INDEX:
      unsupported("GIFsetGraphAttr : GKSM_POLYMARKER_INDEX", attr);
      break;
    case GKSM_PICK_IDENTIFIER:
      unsupported("GIFsetGraphAttr : GKSM_PICK_IDENTIFIER", attr);
      break;
    case GKSM_TEXT_INDEX:
      unsupported("GIFsetGraphAttr : GKSM_TEXT_INDEX", attr);
      break;
    default:
      msgWarn("GIFsetGraphAttr: Unknown code %d\n", code);
    }
  }
  return OK;
}
Beispiel #4
0
/*
 * Set the interior fill-style in an output GIF file.
 * Unsupported
 */
    int
GIFsetFillStyle(Metafile *mf, int num, Gflinter style)
{
    int		imf;
    mf_cgmo		**cgmo	= &mf->cgmo;

    for (imf = 0; imf < num; ++imf) {
      GIFmetafile *meta = find_meta(cgmo[imf]);
      assert(meta);
      set_fillStyle(meta, style);
    }
    return OK;
}
Beispiel #5
0
CCanvasContext::CCanvasContext()
{ 
	globalAlpha = 1.0; 
	m_image = NULL;
	
	set_fillStyle("black");
	set_strokeStyle("black");
	
	m_brushCursor = CGPointMake(0, 0);
	m_brushState = BRUSH_UNFOCUS;

	lineWidth = 1.0;
	lineCap = "butt";
	lineJoin = "milter";
	miterLimit = 10.0;
}