'宣告陣列,將陣列值加入LIST控件中
Dim ss() As String = {"hills.jpg", "Suns.jpg", "lilies.jpg", "Wins.jpg"}
Lst_Img.Items.Add(ss(0))
Lst_Img.Items.Add(ss(1))
Lst_Img.Items.Add(ss(2))
Lst_Img.Items.Add(ss(3))
'插入圖片
Private Function ImgAddIn() As Boolean
Dim Imgbmp As BitmapImage = New BitmapImage() '圖片物件
Dim ImgBrh As ImageBrush = New ImageBrush() '影像筆刷
'BitmapImage
Imgbmp = New BitmapImage(New Uri(sAdImg, UriKind.RelativeOrAbsolute))
ImgBrh.ImageSource = Imgbmp '影像控件 載入 圖片
Dim res As Boolean
'只有圓,矩形,橢圓可以設定圖檔
Select Case SelNm.Substring(0, 2)
Case "Ci"
Canvas_Draw.Children(SelNo).SetValue(Ellipse.FillProperty, ImgBrh)
res = True
Case "Re"
Canvas_Draw.Children(SelNo).SetValue(Rectangle.FillProperty, ImgBrh)
res = True
Case "Ep"
Canvas_Draw.Children(SelNo).SetValue(Ellipse.FillProperty, ImgBrh)
res = True
End Select
Return res
End Function
沒有留言:
張貼留言