Results 1 to 3 of 3

Thread: A problem about the VG_STROKE_CAP_STYLE.

  1. #1
    Junior Member
    Join Date
    Mar 2009
    Posts
    8

    A problem about the VG_STROKE_CAP_STYLE.

    When i drawn a path with the code below:
    Code :
        VGPath path;
        VGfloat m[9];
        VGfloat color[4] = { 1.0f, 1.0f, 1.0f, 1.0f };
        VGint pattern[] = { 50, 30, 20, 10 };
     
        VGfloat colorpaint[4] = { 1.0f, 0.0f, 0.0f, 1.0f };
        VGPaint paint;
        VGubyte segments[] = { VG_MOVE_TO_ABS, VG_LINE_TO_ABS};
        VGfloat coords[]   = { 40.0f, 20.0f, 40.0f, 200.0f};
     
        paint = vgCreatePaint();
        vgSetParameteri(paint, VG_PAINT_TYPE, VG_PAINT_TYPE_COLOR);
        vgSetParameterfv(paint, VG_PAINT_COLOR, 4, colorpaint);
        vgSetPaint(paint, VG_STROKE_PATH);
        vgSetf(VG_STROKE_LINE_WIDTH, 20.0f);
     
        vgSeti(VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE);
        vgLoadIdentity();
     
        path = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F, 1.0f, 0.0f, 0, 0, VG_PATH_CAPABILITY_ALL);
        vgAppendPathData( path, 2, segments, coords );
     
        [color=#FF0040]vgSeti(VG_STROKE_CAP_STYLE, VG_CAP_SQUARE);[/color]  
        vgDrawPath( path,  VG_STROKE_PATH);

    Why there is a gap between the line and the cap?

  2. #2
    Senior Member
    Join Date
    May 2006
    Posts
    353

    Re: A problem about the VG_STROKE_CAP_STYLE.

    Which OpenVG implementation are you using?
    Georg Kolling, Imagination Technologies
    Please ask questions specific to PowerVR hardware or SDKs on the PowerVR Insider Forum
    DevTech@imgtec.com | http://www.powervrinsider.com

  3. #3
    Junior Member
    Join Date
    Mar 2009
    Posts
    8

    Re: A problem about the VG_STROKE_CAP_STYLE.

    Quote Originally Posted by Xmas
    Which OpenVG implementation are you using?
    OpenVG 1.1, released by Khronos Group.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •