• <bdo id='kH2gm'></bdo><ul id='kH2gm'></ul>

    <small id='kH2gm'></small><noframes id='kH2gm'>

  • <tfoot id='kH2gm'></tfoot>

  • <legend id='kH2gm'><style id='kH2gm'><dir id='kH2gm'><q id='kH2gm'></q></dir></style></legend>
  • <i id='kH2gm'><tr id='kH2gm'><dt id='kH2gm'><q id='kH2gm'><span id='kH2gm'><b id='kH2gm'><form id='kH2gm'><ins id='kH2gm'></ins><ul id='kH2gm'></ul><sub id='kH2gm'></sub></form><legend id='kH2gm'></legend><bdo id='kH2gm'><pre id='kH2gm'><center id='kH2gm'></center></pre></bdo></b><th id='kH2gm'></th></span></q></dt></tr></i><div id='kH2gm'><tfoot id='kH2gm'></tfoot><dl id='kH2gm'><fieldset id='kH2gm'></fieldset></dl></div>

        如何用 alpha &lt; 画线1 英寸石英 2d

        时间:2023-10-23
          <legend id='CJEAl'><style id='CJEAl'><dir id='CJEAl'><q id='CJEAl'></q></dir></style></legend>
          <i id='CJEAl'><tr id='CJEAl'><dt id='CJEAl'><q id='CJEAl'><span id='CJEAl'><b id='CJEAl'><form id='CJEAl'><ins id='CJEAl'></ins><ul id='CJEAl'></ul><sub id='CJEAl'></sub></form><legend id='CJEAl'></legend><bdo id='CJEAl'><pre id='CJEAl'><center id='CJEAl'></center></pre></bdo></b><th id='CJEAl'></th></span></q></dt></tr></i><div id='CJEAl'><tfoot id='CJEAl'></tfoot><dl id='CJEAl'><fieldset id='CJEAl'></fieldset></dl></div>
            • <bdo id='CJEAl'></bdo><ul id='CJEAl'></ul>

              <small id='CJEAl'></small><noframes id='CJEAl'>

              <tfoot id='CJEAl'></tfoot>

                    <tbody id='CJEAl'></tbody>
                1. 本文介绍了如何用 alpha &lt; 画线1 英寸石英 2d的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  毫无疑问,这可能是一个重复的问题,但我无法从此处的任何帖子中获得适当的解决方案.因此,我将其发布为新帖子,希望能得到一些解决方案.

                  No doubt this might be a duplicate question but I am not able to get proper solution from any post here. So I am posting this as new post with a hope that I get some solution.

                  在我的绘图应用程序中,我想为要绘制的线条提供不透明度功能.但是当我将 alpha 分配给颜色时,我在线条之间得到了重叠点.

                  I my drawing app I want to give a feature of opacity for lines to be drawn. But when I assign alpha to color, I am getting overlapped points in between the line.

                  我发现在两个视图中绘制可以解决这个问题,但我无法理解其背后的逻辑.

                  Some where I found that drawing in two views solves this issue, but I was not able to understand the logic behind that.

                  我正在使用普通石英二维码在触摸事件上画线.

                  I am using normal quartz 2d code to draw line on touch events.

                  推荐答案

                  嗨..

                  这是我的最终解决方案..我现在在 drawRect 事件上画线,并一次画整条线作为路径..这会产生要保留的不透明度,现在在两者之间没有绘制线帽..

                  This is my final solution.. I am now drawing lines on drawRect event and drawing the entire line at a time as a path.. This creates opacity to retain and now no line caps drawn in between..

                  毫无疑问,这是行之有效的技巧,因为我在每次触摸时都在画,而且这行得通..

                  No doubt this is the trick that is working since I am drawing on every touch and this works..

                  - (void)drawRect:(CGRect)rect {
                  for (int j=0; j<[pathArray count]; j++) 
                  {
                      context = UIGraphicsGetCurrentContext();
                      NSMutableDictionary *tmp=[pathArray objectAtIndex:j];
                      NSMutableArray *currentPath=[tmp objectForKey:@"path"];
                      for (int i=0; i<[currentPath count]; i++) 
                      {
                          CGPoint mid1 = [[self midPoint:[currentPath objectAtIndex:i+1]  :[currentPath objectAtIndex:i]] CGPointValue]; 
                          CGPoint mid2 = [[self midPoint:[currentPath objectAtIndex:i+2] :[currentPath objectAtIndex:i+1]] CGPointValue];
                          CGContextMoveToPoint(context, mid1.x, mid1.y);
                          CGContextAddQuadCurveToPoint(context, [[currentPath objectAtIndex:i+1] CGPointValue].x, [[currentPath objectAtIndex:i+1] CGPointValue].y, mid2.x, mid2.y); 
                          CGContextSetShadow(context, CGSizeMake(-2, -2), 3);
                          CGContextSetAlpha(context, [[tmp objectForKey: @"opacity"] floatValue]);    
                          CGContextSetLineCap(context, kCGLineCapRound);
                          CGContextSetStrokeColorWithColor(context,[[tmp objectForKey: @"Color"] CGColor]);               
                          CGContextSetLineWidth(context, [[tmp objectForKey: @"width"] floatValue]);              
                          i+=2;
                      }   
                      CGContextStrokePath(context);
                  
                  }
                  }
                  

                  这篇关于如何用 alpha &lt; 画线1 英寸石英 2d的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:是什么导致“错过方法"?在这段代码中? 下一篇:Core Telephony 框架在 4.0 中部分公开

                  相关文章

                  <small id='CcgIX'></small><noframes id='CcgIX'>

                  <legend id='CcgIX'><style id='CcgIX'><dir id='CcgIX'><q id='CcgIX'></q></dir></style></legend>

                    <i id='CcgIX'><tr id='CcgIX'><dt id='CcgIX'><q id='CcgIX'><span id='CcgIX'><b id='CcgIX'><form id='CcgIX'><ins id='CcgIX'></ins><ul id='CcgIX'></ul><sub id='CcgIX'></sub></form><legend id='CcgIX'></legend><bdo id='CcgIX'><pre id='CcgIX'><center id='CcgIX'></center></pre></bdo></b><th id='CcgIX'></th></span></q></dt></tr></i><div id='CcgIX'><tfoot id='CcgIX'></tfoot><dl id='CcgIX'><fieldset id='CcgIX'></fieldset></dl></div>

                  1. <tfoot id='CcgIX'></tfoot>

                        <bdo id='CcgIX'></bdo><ul id='CcgIX'></ul>