Пример #1
0
 public uint GetImageInfo(out ImageInfo info)
 {
     info = new ImageInfo();
     info.Height = (uint)bitmap.Height;
     info.pixelFormat = PixelFormatID.PixelFormat32bppARGB;
     info.TileHeight = (uint)bitmap.Height;
     info.TileWidth = (uint)bitmap.Width;
     info.Width = (uint)bitmap.Width;
     info.Xdpi = 92;
     info.Ydpi = 92;
     return 0;
 }
Пример #2
0
        public IImageWrapper(IImage image)
        {
            this.Image = image;
            this.Info = new ImageInfo();
            image.GetImageInfo(out this.Info);

            // bounds should be always at location (0,0)
            this.bounds = new Rectangle(0, 0, (int)this.Info.Width, (int)this.Info.Height);
            this.Size = this.bounds.Size;
            image.GetPhysicalDimension(out this.PhysicalDimension);
            this.physicalFactors.Width = (float)this.PhysicalDimension.Width / this.Size.Width;
            this.physicalFactors.Height = (float)this.PhysicalDimension.Height / this.Size.Height;
        }