当前位置: 首页>>代码示例>>C#>>正文


C# Picture.GetImage方法代码示例

本文整理汇总了C#中Picture.GetImage方法的典型用法代码示例。如果您正苦于以下问题:C# Picture.GetImage方法的具体用法?C# Picture.GetImage怎么用?C# Picture.GetImage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Picture的用法示例。


在下文中一共展示了Picture.GetImage方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PicturePreviewModel

        /// <summary>
        /// Constructor
        /// </summary>
        public PicturePreviewModel(Picture picture)
        {
            Title = picture.Name;

            Created = picture.Date.ToString();

            Resolution = picture.Height.ToString() + "x" + picture.Width.ToString();

            // load source of the image
            ImageSource = new BitmapImage();
            System.IO.Stream stream = picture.GetImage();

            ImageSource.SetSource(stream);
        }
开发者ID:kshark27,项目名称:ZuPix,代码行数:17,代码来源:PicturePreviewModel.cs

示例2: MediaFile

 public MediaFile(string filePath, Picture image)
 {
     this.filePath = filePath;
     this.fileName = System.IO.Path.GetFileName(this.filePath);
     this.type = MimeTypeMapper.GetMimeType(fileName);
     this.size = image.GetImage().Length;
     this.lastModifiedDate = image.Date.ToString();
 }
开发者ID:hermwong,项目名称:phonegap-wp7,代码行数:8,代码来源:Capture.cs

示例3: MediaFile

            public MediaFile(string filePath, Picture image)
            {
                this.FilePath = filePath;
                this.FileName = System.IO.Path.GetFileName(this.FilePath);
                this.Type = MimeTypeMapper.GetMimeType(FileName);
                this.Size = image.GetImage().Length;

                using (IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForApplication())
                {
                    this.LastModifiedDate = storage.GetLastWriteTime(filePath).DateTime.ToString();
                }
            }
开发者ID:rknalakurthi,项目名称:phonegap,代码行数:12,代码来源:Capture.cs

示例4: AddImageToCanvas

        private void AddImageToCanvas(int indexer, Picture picture, int noOnVertical, int noOnHorizontal, int maxCount, DynamicImageCanvas mainCanvas, MyPhoneLockScreen.Model.Point point)
        {
            GC.Collect();
            GC.WaitForPendingFinalizers();
            bool isCompleted = false;
            Deployment.Current.Dispatcher.BeginInvoke(() =>
                                    {
                                        try
                                        {
                                            var actualheight = Application.Current.Host.Content.ActualHeight;
                                            var actualwidth = Application.Current.Host.Content.ActualWidth;

                                            actualheight = actualheight > 800 ? 800 : actualheight;
                                            actualwidth = actualwidth > 480 ? 480 : actualwidth;

                                            //Create and save Dynamic Image

                                            var imageHeight = actualheight / noOnVertical;
                                            var imageWidth = actualwidth / noOnHorizontal;

                                            var left = (point.X * imageWidth) + (15 * point.X);
                                            var top = (point.Y * imageHeight) + (15 * point.Y);

                                            var image = new Image();
                                            var imag = new BitmapImage();
                                            imag.DecodePixelHeight = (int)imageHeight;
                                            imag.DecodePixelWidth = (int)imageWidth;
                                            imag.SetSource(picture.GetImage());
                                            image.Source = imag;
                                            image.Height = imageHeight;
                                            image.Width = imageWidth;
                                            mainCanvas.AddImage(image, left, top);
                                            image = null;
                                            imag = null;
                                        }
                                        catch (Exception ex)
                                        {
                                            Debug.WriteLine(ex.StackTrace);
                                        }
                                        finally
                                        {
                                            isCompleted = true;
                                        }
                                    });
            while (true)
            {
                if (isCompleted)
                    break;
            }
        }
开发者ID:Hitchhikrr,项目名称:CreaMed,代码行数:50,代码来源:ScheduledAgent.cs

示例5: GetImage

 private BitmapImage GetImage(Picture picture)
 {
     BitmapImage image = new BitmapImage();
     image.CreateOptions = BitmapCreateOptions.None;
     image.SetSource(picture.GetImage());
     return image;
 }
开发者ID:GregOnNet,项目名称:WP8BookSamples,代码行数:7,代码来源:MainPage.xaml.cs

示例6: ShowPicture

        public void ShowPicture(Picture picture)
        {
            lock (this)
            {
                if (m_Picture != picture && picture != null)
                {
                    m_Picture = picture;
                    System.Drawing.Bitmap bitmap = m_Picture.GetImage(m_DataType);
                    if (bitmap != null)
                    {
                        m_Image.Source = Utils.CreateBitmapSourceFromBitmap(bitmap);
                        m_numberOfMbInRow = bitmap.Width >> 4;
                        m_numberOfMbInCol = bitmap.Height >> 4;
                        m_numberOfMb = (m_numberOfMbInRow * m_numberOfMbInCol);

                        if (m_LastSelectedMacroblockAddress != -1)
                        {
                            double mbWidth, mbHeight;
                            int mbX, mbY;
                            GetMbPosition(m_LastSelectedMacroblockAddress, out mbX, out mbY, out mbWidth, out mbHeight);
                            SelectMB(mbX, mbY, m_LastSelectedMacroblockAddress, mbWidth, mbHeight, true, true);
                        }
                    }
                }
            }
        }
开发者ID:sarandogou,项目名称:thialgou,代码行数:26,代码来源:ScreenPictureView.xaml.cs

示例7: UploadPhoto

        /// <summary>
        /// Uploads the given picture to the server.
        /// </summary>
        /// <param name="picture">A Media Library picture.</param>
        private void UploadPhoto(Picture picture)
        {
            // Load the photo taken with the camera into memory.
            Stream imageStream = picture.GetImage();
            int imageSize = (int)imageStream.Length;
            BinaryReader binReader = new BinaryReader(imageStream);
            byte[] imageBytes = new byte[imageSize];
            int count = binReader.Read(imageBytes, 0, (int)imageSize);
            binReader.Close();

            // Upload the image to the server.
            App.ServerConnection.UploadPhoto(
                (int) App.LoginUserID,
                imageBytes,
                new EventDelegates.HTTPResponseDelegate(UploadSucceeded),
                new EventDelegates.HTTPFailDelegate(UploadFailed));
        }
开发者ID:andabereczky,项目名称:GeoSightWinPhone7,代码行数:21,代码来源:MainPage.xaml.cs


注:本文中的Picture.GetImage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。