public void DrawLine_LineWidths()
        {
            var doc = new PortableDocument();

            doc.AddPage(100, 100);
            double x  = 0;
            double y0 = 78;
            double y1 = 10;

            doc.DrawLine(20, 95, 20, 80);

            doc.SetLineWidth(0.1);
            doc.DrawLine(x += 10, y0, x, y1);

            doc.SetLineWidth(1);
            doc.DrawLine(x += 10, y0, x, y1);

            doc.SetLineWidth(2);
            doc.DrawLine(x += 10, y0, x, y1);

            doc.SetLineWidth(3);
            doc.DrawLine(x += 10, y0, x, y1);

            doc.Save(Folder + "DrawLine_LineWidths.pdf");
        }
        public void DrawLine()
        {
            var doc = new PortableDocument();

            doc.AddPage(200, 100);
            doc.DrawLine(50, 50, 100, 70);
            doc.Save(Folder + "DrawLine.pdf");
        }
        public void DrawLine_LineDashPatterns()
        {
            var doc = new PortableDocument();

            doc.AddPage(100, 100);
            double x0 = 10;
            double x1 = 40;
            double y  = 100;
            double dy = -5;

            doc.SetLineWidth(1);

            // default dash pattern
            doc.DrawLine(x0, y += dy, x1, y);

            doc.SetLineDashPattern(new double[] { }, 0);
            doc.DrawLine(x0, y += dy, x1, y);

            doc.SetLineDashPattern(new[] { 3d }, 0);
            doc.DrawLine(x0, y += dy, x1, y);

            doc.SetLineDashPattern(new[] { 2d }, 1);
            doc.DrawLine(x0, y += dy, x1, y);

            doc.SetLineDashPattern(new[] { 2d, 1 }, 0);
            doc.DrawLine(x0, y += dy, x1, y);

            doc.SetLineDashPattern(new[] { 3d, 5 }, 6);
            doc.DrawLine(x0, y += dy, x1, y);

            doc.SetLineDashPattern(new[] { 2d, 3 }, 11);
            doc.DrawLine(x0, y += dy, x1, y);

            doc.Save(Folder + "DrawLine_LineDashPatterns.pdf");
        }
        public void DrawLine_Colors()
        {
            var doc = new PortableDocument();

            doc.AddPage(100, 100);
            double x  = 0;
            double y0 = 78;
            double y1 = 10;

            doc.DrawLine(10, 95, 10, 80);

            doc.SetColor(0, 0, 0);
            doc.DrawLine(x += 10, y0, x, y1);

            doc.SetColor(1, 1, 1);
            doc.DrawLine(x += 10, y0, x, y1);

            doc.SetColor(1, 0, 0);
            doc.DrawLine(x += 10, y0, x, y1);

            doc.SetColor(0, 1, 0);
            doc.DrawLine(x += 10, y0, x, y1);

            doc.SetColor(0, 0, 1);
            doc.DrawLine(x += 10, y0, x, y1);

            doc.SetColor(1, 1, 0);
            doc.DrawLine(x += 10, y0, x, y1);

            doc.Save(Folder + "DrawLine_Colors.pdf");
        }
예제 #5
0
        public void DrawLine_LineDashPatterns()
        {
            var doc = new PortableDocument();
            doc.AddPage(100, 100);
            double x0 = 10;
            double x1 = 40;
            double y = 100;
            double dy = -5;

            doc.SetLineWidth(1);

            // default dash pattern
            doc.DrawLine(x0, y += dy, x1, y);

            doc.SetLineDashPattern(new double[] { }, 0);
            doc.DrawLine(x0, y += dy, x1, y);

            doc.SetLineDashPattern(new[] { 3d }, 0);
            doc.DrawLine(x0, y += dy, x1, y);

            doc.SetLineDashPattern(new[] { 2d }, 1);
            doc.DrawLine(x0, y += dy, x1, y);

            doc.SetLineDashPattern(new[] { 2d, 1 }, 0);
            doc.DrawLine(x0, y += dy, x1, y);

            doc.SetLineDashPattern(new[] { 3d, 5 }, 6);
            doc.DrawLine(x0, y += dy, x1, y);

            doc.SetLineDashPattern(new[] { 2d, 3 }, 11);
            doc.DrawLine(x0, y += dy, x1, y);

            doc.Save(Folder + "DrawLine_LineDashPatterns.pdf");
        }
예제 #6
0
        public void DrawLine_LineWidths()
        {
            var doc = new PortableDocument();
            doc.AddPage(100, 100);
            double x = 0;
            double y0 = 78;
            double y1 = 10;

            doc.DrawLine(20, 95, 20, 80);

            doc.SetLineWidth(0.1);
            doc.DrawLine(x += 10, y0, x, y1);

            doc.SetLineWidth(1);
            doc.DrawLine(x += 10, y0, x, y1);

            doc.SetLineWidth(2);
            doc.DrawLine(x += 10, y0, x, y1);

            doc.SetLineWidth(3);
            doc.DrawLine(x += 10, y0, x, y1);

            doc.Save(Folder + "DrawLine_LineWidths.pdf");
        }
예제 #7
0
        public void DrawLine_Colors()
        {
            var doc = new PortableDocument();
            doc.AddPage(100, 100);
            double x = 0;
            double y0 = 78;
            double y1 = 10;

            doc.DrawLine(10, 95, 10, 80);

            doc.SetColor(0, 0, 0);
            doc.DrawLine(x += 10, y0, x, y1);

            doc.SetColor(1, 1, 1);
            doc.DrawLine(x += 10, y0, x, y1);

            doc.SetColor(1, 0, 0);
            doc.DrawLine(x += 10, y0, x, y1);

            doc.SetColor(0, 1, 0);
            doc.DrawLine(x += 10, y0, x, y1);

            doc.SetColor(0, 0, 1);
            doc.DrawLine(x += 10, y0, x, y1);

            doc.SetColor(1, 1, 0);
            doc.DrawLine(x += 10, y0, x, y1);

            doc.Save(Folder + "DrawLine_Colors.pdf");
        }
예제 #8
0
 public void DrawLine()
 {
     var doc = new PortableDocument();
     doc.AddPage(200, 100);
     doc.DrawLine(50, 50, 100, 70);
     doc.Save(Folder + "DrawLine.pdf");
 }
예제 #9
0
        private async void submit_Click(object sender, RoutedEventArgs e)
        {
            WriteableBitmap bmpCurrentScreenImage = new WriteableBitmap((int)this.ActualWidth, (int)this.ActualHeight);

            bmpCurrentScreenImage.Render(ContentPanel, new MatrixTransform());
            bmpCurrentScreenImage.Invalidate();
            var fileName = String.Format("MyImage_{0:}.jpg", DateTime.Now.Ticks);

            SaveToMediaLibrary(bmpCurrentScreenImage, fileName, 100);
            MessageBox.Show("Image successfully Captured and saved!");
            string urlbase = String.Concat("http://searchtweets.bugs3.com/mail_image.php?to=", email.Text.Trim());

            Debug.WriteLine(email.Text + roll.Text);


            System.Diagnostics.Debug.WriteLine("Woah1!");
            var doc = new PortableDocument();

            System.Diagnostics.Debug.WriteLine("Woah2!");
            doc.Title = "Experiment";
            System.Diagnostics.Debug.WriteLine("Woah3!");
            doc.Author = "User_UnKnown";
            doc.AddPage(PageSize.A4);
            doc.SetFont("Arial", 48);
            doc.DrawText(doc.PageWidth / 4, doc.PageHeight - 50, "Experiment Info");
            doc.DrawLine(0, doc.PageHeight - 60, doc.PageWidth, doc.PageHeight - 60);

            //doc.DrawImage(portableImage);
            doc.SetFont("Arial", 24);
            System.Diagnostics.Debug.WriteLine("Woah4!");
            double xi = 50;
            double yi = doc.PageHeight - 200;

            foreach (DataPoint d in list_new)
            {
                doc.DrawText(xi, yi, "X:" + d.X.ToString() + " Y: " + d.Y.ToString());
                yi = yi - 50;
            }

            doc.DrawText(50, 400, "End of Document");
            //doc.DrawImage(portableImage);
            doc.Save(TestStream());
            System.Diagnostics.Debug.WriteLine("Woah5!");
            if (File.Exists("exampleExperiment1.pdf"))
            {
                System.Diagnostics.Debug.WriteLine("It Does Exist!");
                FileStream    pdfFile2 = File.OpenRead("exampleExperiment1.pdf");
                StorageFolder local    = Windows.Storage.ApplicationData.Current.LocalFolder;
                Windows.Storage.StorageFolder installedLocation = Windows.ApplicationModel.Package.Current.InstalledLocation;

                System.Diagnostics.Debug.WriteLine(Path.GetFullPath("exampleExperiment1.pdf"));
                System.Diagnostics.Debug.WriteLine(installedLocation.Path);
                // Access the PDF.
                //StorageFile pdfFile = await local.GetFileAsync("C:\\Data\\Programs\\{61044A2A-FAB3-4925-BDAE-498DEB9E35EA}\\Install\\exampleExperiment1.pdf");
                //Windows.System.Launcher.LaunchFileAsync(pdfFile);
                StorageFile pdfFile = await installedLocation.GetFileAsync("exampleExperiment1.pdf");

                Windows.System.Launcher.LaunchFileAsync(pdfFile);
            }
            else
            {
                System.Diagnostics.Debug.WriteLine("Sorry Man! It Doesn't");
            }
        }