gFinger 손끝으로 만드는 세상

Table Of Contens

1. Code

2. Reference

 

 

1. Code


 

        {
            InitializeComponent();

            # region Tap Event Handler

            TapGestureRecognizer objTapGestureRecognizer = new TapGestureRecognizer();
            objTapGestureRecognizer.Tapped += ((o2, e2) =>
            {
                OnDismissButtonClicked();
            });

            this.Content.GestureRecognizers.Add(objTapGestureRecognizer);

            #endregion
        }
        
        async void OnDismissButtonClicked( )
        {
            ....
        }

 

 

2. Reference


 

https://stackoverflow.com/questions/26566375/how-to-add-a-click-handler-to-content-page-in-xamarin-forms

 

How to add a click handler to content page in xamarin forms

I am new at Xamarin.Forms and are trying to add a click event to my content page. I want an event to start when the user clicks on the page, no matter where. I've created similar functionality in a

stackoverflow.com

 

 

 

 

Table Of Contens

1. Class Example

2. Reference

1. Example

 
  class ProcessingSVG
    {
        public List SVGlist = new List();

        // SVG를 처리하는 Class
        public class SvgClass
        {   
            private SkiaSharp.Extended.Svg.SKSvg svg;  

           
            // Get file .svg to folder Images 
            // Form Embeded Resoure 
            Stream GetImageStream(string svgName, Type PageType)
            {

                TypeInfo PageInfo = PageType.GetTypeInfo();
                Assembly assembly = PageInfo.Assembly;

                var abc = assembly.GetManifestResourceStream($"{assembly.GetName().Name}.Images.{svgName}");
                return abc;
            }
 

            //  return picture of the SVG
            public SKPicture GetPicture()
            {
                return svg.Picture;
            }

            public void LoadSvg(string svgName, Type PageType)
            {
                // create a new SVG object
                svg = new SkiaSharp.Extended.Svg.SKSvg(); 
                // load the SVG document from a stream 
                using (var stream = GetImageStream(svgName, PageType))
                    svg.Load(stream);
            }
        } 
    }
    
    
    
        // Save  SVG File 
        ProcessingSVG XX_SVG = new ProcessingSVG();
        const int NumberOfSVG = 10;
        void LoadSVGimage()
        {
            // Data Exist
            if (XX_SVG.SVGlist != null) XX_SVG.SVGlist.Clear();

            for(int i=0; i< NumberOfSVG; i++)
            {
                var oneSVG = new ProcessingSVG.SvgClass();
                oneSVG.LoadSvg("test"+i.ToString()+".svg", typeof(MainPage));
                XX_SVG.SVGlist.Add(oneSVG); 
            } 
        }
        

       // Draw SVG Picture
          canvasXX.Save();
          canvasXX.Scale(0.1f); 
          canvasXX.DrawPicture(XX_SVG.SVGlist[7].GetPicture(), 0,0);
          canvasXX.Restore();
          
          

 

2. Reference


https://stackoverflow.com/questions/58259473/how-to-load-file-svg-with-skiasharp-on-xamarin-forms

 

Table Of Contens

1. SkShader Class Example

2. Reference

 

1. SkShader Class Example

 
        public void FillSpotGradient(SKCanvas canvas, float width, float height)
        {
            float selectedSize = Math.Min(width, height);


                // create the shader
                var colors = new SKColor[]
                {
                    new SKColor(0, 255, 255),
                    new SKColor(255, 0, 255),
                    new SKColor(255, 255, 0),
                    new SKColor(0, 255, 255)
                };
                var shader = SKShader.CreateSweepGradient
                (
                    new SKPoint(width / 3, height / 3),
                    colors,
                    null
                );

                // use the shader
                var paint = new SKPaint
                {
                    Shader = shader
                };
                canvas.DrawPaint(paint); 
        }

 

2. Reference


https://docs.microsoft.com/en-us/dotnet/api/skiasharp.skshader?view=skiasharp-1.68.1

 

SKShader Class (SkiaSharp)

Shaders specify the source color(s) for what is being drawn in the .

docs.microsoft.com

 

 

정규식으로 치환 하면 쉽게 되는데 너무 복잡해서 잘 사용하지 않는데 마음을 다잡고 다시 한번 해봄 ㅠㅠ

. 으로 시작하고 알파벳 대문자열 그리고 숫자열 그리고 ;로 끝나는 문자를 ()안의 정규식 검색 결과로 치환

(\.[A-Z]+)[0-9]+";

$1

 

 

PIC의 CPU 구조는 Hoffman memory architecture라서

아래와 같은 명령어는  "Error#90  Attempt to create a pointer to a constant" Error를 발생시킨다고 한다.

 

if (!strcmp(command ,"aaaa"))

 

참조 :

https://www.ccsinfo.com/forum/viewtopic.php?p=71942