以下SVG路径可以绘制一个圆的99.99%:(在http://jsfiddle.net/DFhUF/46/上尝试它,看看你是否看到4个弧或只有2个,但请注意,如果它是IE,它会被渲染在VML中,而不是SVG,但有类似的问题)
M 100 100 a 50 50 0 1 0 0.00001 0
Run Code Online (Sandbox Code Playgroud)
但是当它是一个圆圈的99.99999999%时,什么都没有显示出来?
M 100 100 a 50 50 0 1 0 0.00000001 0
Run Code Online (Sandbox Code Playgroud)
这与100%的圆圈相同(它仍然是弧形,不是它,只是一个非常完整的圆弧)
M 100 100 a 50 50 0 1 0 0 0
Run Code Online (Sandbox Code Playgroud)
怎么能修好?原因是我使用一个函数绘制一个弧的百分比,如果我需要"特殊情况"一个99.9999%或100%的弧来使用圆函数,那就太傻了.
同样,使用RaphaelJS的jsfiddle上的测试用例位于http://jsfiddle.net/DFhUF/46/
(如果它是IE 8上的VML,即使第二个圆圈也不会显示......你必须将它改为0.01)
更新:
这是因为我在我们的系统中为得分渲染弧,所以3.3点得到1/3的圆.0.5得到半圈,9.9得到99%的圈.但是如果我们的系统中得分为9.99呢?我是否必须检查它是否接近圆的99.999%,并相应地使用arc函数或circle函数?那么得分9.9987怎么样?哪一个使用?要知道什么样的分数将映射到"太完整的圆圈"并切换到圆形函数是荒谬的,当它是圆圈的"某个99.9%"或9.9987分数时,则使用弧函数.
我需要建立一个用手指在画布上绘画的项目,
得到我的手指的触摸事件和动作事件,然后绘制.
任何人都可以建议我如何开始项目,
什么是做这样的事情的最佳组件?
我想创建一个空位图并将canvas设置为该位图,然后在位图上绘制任何形状.
我正在玩绘图路径,我注意到至少在某些情况下,UIBezierPath优于我认为的Core Graphics等价物.-drawRect:下面的方法创建两个路径:一个UIBezierPath和一个CGPath.除了它们的位置之外,路径是相同的,但是抚摸CGPath所需的时间大约是抚摸UIBezierPath的两倍.
- (void)drawRect:(CGRect)rect
{
CGContextRef ctx = UIGraphicsGetCurrentContext();
// Create the two paths, cgpath and uipath.
CGMutablePathRef cgpath = CGPathCreateMutable();
CGPathMoveToPoint(cgpath, NULL, 0, 100);
UIBezierPath *uipath = [[UIBezierPath alloc] init];
[uipath moveToPoint:CGPointMake(0, 200)];
// Add 200 curve segments to each path.
int iterations = 200;
CGFloat cgBaseline = 100;
CGFloat uiBaseline = 200;
CGFloat xincrement = self.bounds.size.width / iterations;
for (CGFloat x1 = 0, x2 = xincrement;
x2 < self.bounds.size.width;
x1 = x2, x2 += xincrement)
{ …Run Code Online (Sandbox Code Playgroud) 我有一个有趣的问题.想象一下,我有很多数据在非常快的时间间隔内发生变化.我想在控制台应用程序中将该数据显示为表格.f.ex:
-------------------------------------------------------------------------
| Column 1 | Column 2 | Column 3 | Column 4 |
-------------------------------------------------------------------------
| | | | |
| | | | |
| | | | |
-------------------------------------------------------------------------
Run Code Online (Sandbox Code Playgroud)
如何保持快速以及如何修复列宽?我知道如何在java中做到这一点,但我不知道它是如何在C#中完成的.
我有以下问题.我想用c#windows形式制作一些图形.我想读取位图到我的程序,然后在这个位图上写一些文字.最后我希望这张图片加载到pictureBox.这是我的问题.我该怎么做?
如何,它必须如何工作:
Bitmap a = new Bitmap(@"path\picture.bmp");
a.makeTransparent();
// ? a.writeText("some text", positionX, positionY);
pictuteBox1.Image = a;
Run Code Online (Sandbox Code Playgroud)
有可能做到吗?
我有一个基本上像绘图应用程序的程序.但是,我的程序有一些闪烁的问题.我的代码中有以下行(它应该摆脱闪烁 - 但不是):
this.SetStyle(ControlStyles.AllPaintingInWmPaint
| ControlStyles.UserPaint | ControlStyles.DoubleBuffer, true);
Run Code Online (Sandbox Code Playgroud)
我的代码(减去形状的超类和子类如下:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Paint
{
public partial class Paint : Form
{
private Point startPoint;
private Point endPoint;
private Rectangle rect = new Rectangle();
private Int32 brushThickness = 0;
private Boolean drawSPaint = false;
private List<Shapes> listOfShapes = new List<Shapes>();
private Color currentColor;
private Color currentBoarderColor;
private Boolean IsShapeRectangle = false;
private Boolean IsShapeCircle = false; …Run Code Online (Sandbox Code Playgroud) 是否有可能在Android上绘制未填充的数据?默认情况下,填充圆圈和矩形.
我正在开发iPhone上的草图应用程序.我得到了它的工作,但不是在这里看到的漂亮

我正在寻找任何平滑绘图的建议基本上,我所做的是当用户将手指放在我调用的屏幕上时
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
Run Code Online (Sandbox Code Playgroud)
然后我收集一个阵列中的单个触摸
- (void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
Run Code Online (Sandbox Code Playgroud)
当用户从屏幕上拿出一根手指时,我打了个电话
- (void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
Run Code Online (Sandbox Code Playgroud)
然后我用数字绘制数组中的所有点
NSMutableArray *points = [collectedArray points];
CGPoint firstPoint;
[[points objectAtIndex:0] getValue:&firstPoint];
CGContextMoveToPoint(context, firstPoint.x, firstPoint.y);
CGContextSetLineCap(context, kCGLineCapRound);
CGContextSetLineJoin(context, kCGLineJoinRound);
for (int i=1; i < [points count]; i++) {
NSValue *value = [points objectAtIndex:i];
CGPoint point;
[value getValue:&point];
CGContextAddLineToPoint(context, point.x, point.y);
}
CGContextStrokePath(context);
UIGraphicsPushContext(context);
Run Code Online (Sandbox Code Playgroud)
而现在我想改进绘图更像是"Sketch Book"App

我认为与信号处理算法有关,要重新排列阵列中的所有点,但我不确定.任何帮助将非常感激.
提前谢谢:)