类Graphics2D同样提供了绘制位图的方法,drawImage(). 下面的例子显示卫星地图。卫星地图有卫星照片和道路名称组合而成,所选的原始图像,可以参见
http://www.mapdigit.com/guidebeemap/maptile.php?type=MICROSOFTSATELLITE&x=7&y=4&z=14 maptile_7_4.jpg | |
http://www.mapdigit.com/guidebeemap/maptile.php?type=MICROSOFTSATELLITE&x=6&y=4&z=14 maptile_6_4.jpg | |
http://www.mapdigit.com/guidebeemap/maptile.php?type=GOOGLEHYBRID&x=7&y=4&z=14 maptile_7_4.png | |
http://www.mapdigit.com/guidebeemap/maptile.php?type=GOOGLEHYBRID&x=6&y=4&z=14 maptile_6_4.png |
private voID DrawMap(){ BitmAPImage img = new BitmAPImage(); img.CreateOptions = BitmapCreateOptions.None; string path = "/SilverlightGraphics2DDemo;component/map/maptile_6_4.jpg"; Stream s = Application.GetResourceStream(new Uri(path,UriKind.relative)).Stream; img.SetSource(s); WriteableBitmap writeableBitmap = new WriteableBitmap(img); graphics2D.Clear(color.White); graphics2D.DrawImage(writeableBitmap.Pixels,256,0); path = "/SilverlightGraphics2DDemo;component/map/maptile_7_4.jpg"; s = Application.GetResourceStream(new Uri(path,UriKind.relative)).Stream; img.SetSource(s); writeableBitmap = new WriteableBitmap(img); graphics2D.DrawImage(writeableBitmap.Pixels,0); path = "/SilverlightGraphics2DDemo;component/map/maptile_6_4.png"; s = Application.GetResourceStream(new Uri(path,0); path = "/SilverlightGraphics2DDemo;component/map/maptile_7_4.png"; s = Application.GetResourceStream(new Uri(path,0);}总结
以上是内存溢出为你收集整理的Silverlight 引路蜂二维图形库示例:显示位图全部内容,希望文章能够帮你解决Silverlight 引路蜂二维图形库示例:显示位图所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)