highlight test

int posX = 50;
int poxY = 100;
int spriteWidth = 50;
int spriteHeight = 100;
Uri uri2 = new Uri("/MusicSearch;component/Notes/note3.png", UriKind.Relative);
ImageSource noteListImageMap = new BitmapImage(uri2);
RectangleGeometry xRect = new RectangleGeometry();
xRect.Rect = new Rect(posX, poxY, spriteWidth, spriteHeight);
myImage.Source = noteListImageMap;
myImage.Stretch = Stretch.None;
myImage.Width = 350;
myImage.Height = 2900;
myImage.Clip = xRect;
TranslateTransform translateTransform = new TranslateTransform();
translateTransform.X = -posX;
translateTransform.Y = -poxY;
myImage.RenderTransform = translateTransform; 
posted @ 2009-12-05 22:52  风海迷沙  阅读(276)  评论(0编辑  收藏  举报