2009年5月20日

Read EXIF Jpeg Metadata in Silverlight

如果 user 想要上傳檔案的時後,可以先讀取 EXIF Jpeg Metadata 可以省去使用者不少輸入相關資料的時間。可惜,Silverlight 似乎沒有支援這些功能,而只能有 JavaScript 來處理。 [Reference] Javascript EXIF Reader: http://www.nihilogic.dk/labs/exif/ Read EXIF Jpeg Metadata in Silverlight: http://silverlight.net/forums/t/68464.aspx EXIFextractor library to extract EXIF information (C#): http://www.codeproject.com/KB/graphics/exifextractor.aspx

2009年5月4日

2009年5月3日

Create a Path at Rutime

我需要利用 Silverlight 設計裁切照片的工具,
例如,讓 user 框選照片中的大頭,裁切下來,並加以應用。
因此,在 runtime 建立一組 path,
並隨著 user 的 click 新增 node,
是一項重要的流程。

以下是我利用 path 畫出一個正方形的範例,
並以 canvas 為其父物件。為了讓範例簡化,
click、clip、image 等部分的處理,並沒有加入範例中。

Path path = new Path();

PathGeometry pathGeometry = new PathGeometry();
path.Data = pathGeometry;
pathGeometry.Figures = new PathFigureCollection();

PathFigure figur = new PathFigure();
pathGeometry.Figures.Add(figur);

figur.StartPoint = new Point(0, 0);

LineSegment seg1 = new LineSegment();
seg1.Point = new Point(100, 0);
figur.Segments.Add(seg1);

LineSegment seg2 = new LineSegment();
seg2.Point = new Point(100, 100);
figur.Segments.Add(seg2);

LineSegment seg3 = new LineSegment();
seg3.Point = new Point(0, 100);
figur.Segments.Add(seg3);

path.Fill = new SolidColorBrush(Colors.Blue);
Canvas.SetTop(path, 200);
Canvas.SetLeft(path, 300);

Canvas canvas = new Canvas();
canvas.Background = new SolidColorBrush(Colors.DarkGray);
canvas.Width = 50;
canvas.Height = 50;
canvas.HorizontalAlignment = HorizontalAlignment.Left;
canvas.VerticalAlignment = VerticalAlignment.Top;
canvas.Children.Add(path);

this.LayoutRoot.Children.Add(canvas);
[refernece]
How to draw a path at runtime

Deploying Vue & .NET with Google OAuth on GCP Cloud Run

Deploying Vue & .NET with Google OAuth on GCP Cloud Run Deploying Vue & .NET with Google OAuth on GCP Cloud Run...