本文整理汇总了C#中IImage.GetImageInfo方法的典型用法代码示例。如果您正苦于以下问题:C# IImage.GetImageInfo方法的具体用法?C# IImage.GetImageInfo怎么用?C# IImage.GetImageInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IImage
的用法示例。
在下文中一共展示了IImage.GetImageInfo方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IImageWrapper
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;
}
示例2: GetImageSize
public static bool GetImageSize(IImage inputIImage, out Size resultSize)
{
resultSize = new Size(0, 0);
IImagingFactory newIImagingFactory = new ImagingFactoryClass();
ImageInfo newImageInfo;
try
{
inputIImage.GetImageInfo(out newImageInfo);
resultSize = new Size((int)newImageInfo.Width, (int)newImageInfo.Height);
}
catch
{
return false;
}
return true;
}
示例3: SetImages
public void SetImages()
{
_leftPart = MasterForm.SkinManager.GetImage("IconButtonLeft");
_rightPart = MasterForm.SkinManager.GetImage("IconButtonRight");
_centerPart = MasterForm.SkinManager.GetImage("IconButtonCenter");
switch (_iconType)
{
case WideButtonWithIconType.Open:
_icon = MasterForm.SkinManager.GetImage("IconButtonIconOpen");
break;
case WideButtonWithIconType.Photo:
_icon = MasterForm.SkinManager.GetImage("IconButtonIconPhoto");
break;
case WideButtonWithIconType.Write:
_icon = MasterForm.SkinManager.GetImage("IconButtonIconWrite");
break;
}
_leftPartPressed = MasterForm.SkinManager.GetImage("IconButtonLeftPressed");
_rightPartPressed = MasterForm.SkinManager.GetImage("IconButtonRightPressed");
_centerPartPressed = MasterForm.SkinManager.GetImage("IconButtonCenterPressed");
ImageInfo ii;
if (_leftPart != null)
{
_leftPart.GetImageInfo(out ii);
_leftPartSize = new Size((int)ii.Width, (int)ii.Height);
}
if (_rightPart != null)
{
_rightPart.GetImageInfo(out ii);
_rightPartSize = new Size((int)ii.Width, (int)ii.Height);
}
if (_icon != null)
{
_icon.GetImageInfo(out ii);
_iconSize = new Size((int)ii.Width, (int)ii.Height);
}
//if (_centerPart != null)
//{
// _centerPart.GetImageInfo(out ii);
//}
//if (_leftPartPressed != null)
//{
// _leftPartPressed.GetImageInfo(out ii);
//}
//if (_rightPartPressed != null)
//{
// _rightPartPressed.GetImageInfo(out ii);
//}
//if (_centerPartPressed != null)
//{
// _centerPartPressed.GetImageInfo(out ii);
//}
}
示例4: SetImages
public void SetImages()
{
_leftPart = MasterForm.SkinManager.GetImage("Status1");
_rightPart = MasterForm.SkinManager.GetImage("Status3");
_centerPart = MasterForm.SkinManager.GetImage("Status2");
ImageInfo ii;
if (_leftPart != null)
{
_leftPart.GetImageInfo(out ii);
_leftPartSize = new Size((int)ii.Width, (int)ii.Height);
}
if (_rightPart != null)
{
_rightPart.GetImageInfo(out ii);
_rightPartSize = new Size((int)ii.Width, (int)ii.Height);
}
if (_centerPart != null)
{
_centerPart.GetImageInfo(out ii);
_centerPartSize = new Size((int)ii.Width, (int)ii.Height);
}
_leftPartPressed = MasterForm.SkinManager.GetImage("Status1Pressed");
_rightPartPressed = MasterForm.SkinManager.GetImage("Status3Pressed");
_centerPartPressed = MasterForm.SkinManager.GetImage("Status2Pressed");
if (_leftPartPressed != null)
{
_leftPartPressed.GetImageInfo(out ii);
_leftPartSizePressed = new Size((int)ii.Width, (int)ii.Height);
}
if (_rightPartPressed != null)
{
_rightPartPressed.GetImageInfo(out ii);
_rightPartSizePressed = new Size((int)ii.Width, (int)ii.Height);
}
if (_centerPartPressed != null)
{
_centerPartPressed.GetImageInfo(out ii);
_centerPartSizePressed = new Size((int)ii.Width, (int)ii.Height);
}
}
示例5: WindowsCEBitmap
public WindowsCEBitmap(IImage image)
{
myImage = image;
myImage.GetImageInfo(out myImageInfo);
myScaleFactorX = 1 / myImageInfo.Xdpi * 2540;
myScaleFactorY = 1 / myImageInfo.Ydpi * 2540;
myBuffer = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(RECT)));
}
示例6: DrawImageAlphaChannel
public static void DrawImageAlphaChannel(this Graphics gx, IImage image, int x, int y)
{
ImageInfo imageInfo = new ImageInfo();
image.GetImageInfo(out imageInfo);
Rectangle rc = new Rectangle(x, y, (int)imageInfo.Width + x, (int)imageInfo.Height + y);
IntPtr hdc = gx.GetHdc();
image.Draw(hdc, ref rc, IntPtr.Zero);
gx.ReleaseHdc(hdc);
}
示例7: DrawImageAlphaChannelTiled
public void DrawImageAlphaChannelTiled(IImage image, int x, int y, bool horizontal, int maxwidth)
{
ImageInfo imageInfo = new ImageInfo();
image.GetImageInfo(out imageInfo);
if (horizontal)
{
int width = Math.Max((int)imageInfo.Width, maxwidth);
Rectangle rc = new Rectangle(x, y, x + width, (int)imageInfo.Height + y);
image.Draw(_hdc, ref rc, IntPtr.Zero);
}
else
{
throw new NotImplementedException();
}
}
示例8: DrawImageAlphaChannel
public void DrawImageAlphaChannel(IImage image, int x, int y)
{
ImageInfo imageInfo = new ImageInfo();
image.GetImageInfo(out imageInfo);
Rectangle rc = new Rectangle(x, y, (int)imageInfo.Width + x, (int)imageInfo.Height + y);
//Rectangle rcSrc = new Rectangle();
image.Draw(_hdc, ref rc, IntPtr.Zero);
}
示例9: IImageToBitmap
public static Bitmap IImageToBitmap(IImage image)
{
ImageInfo imageInfo = new ImageInfo();
IBitmapImage bitmapToConvert;
Bitmap toReturn;
image.GetImageInfo(out imageInfo);
Size scaledSize = new Size();
Double xFactor = new Double();
Double yFactor = new Double();
xFactor = 1;
yFactor = 1;
scaledSize.Width = Convert.ToInt16(imageInfo.Width * Math.Min(xFactor, yFactor));
scaledSize.Height = Convert.ToInt16(imageInfo.Height * Math.Min(xFactor, yFactor));
imageFactory.CreateBitmapFromImage(image,
(uint)scaledSize.Width, (uint)scaledSize.Height,
imageInfo.PixelFormat, InterpolationHint.InterpolationHintDefault,
out bitmapToConvert);
toReturn = new Bitmap(scaledSize.Width, scaledSize.Height);
toReturn = ImageUtils.IBitmapImageToBitmap(bitmapToConvert);
return toReturn;
}
示例10: SetImages
public void SetImages(IImage leftBorder, IImage rightBorder, IImage topBorder, IImage bottomBorder)
{
_leftBorder = leftBorder;
_rightBorder = rightBorder;
_topBorder = topBorder;
_bottomBorder = bottomBorder;
ImageInfo ii;
if (_leftBorder != null)
{
_leftBorder.GetImageInfo(out ii);
_leftBorderSize = new Size((int)ii.Width, (int)ii.Height);
}
if (_rightBorder != null)
{
_rightBorder.GetImageInfo(out ii);
_rightBorderSize = new Size((int)ii.Width, (int)ii.Height);
}
if (_topBorder != null)
{
_topBorder.GetImageInfo(out ii);
_topBorderSize = new Size((int)ii.Width, (int)ii.Height);
}
if (_bottomBorder != null)
{
_bottomBorder.GetImageInfo(out ii);
_bottomBorderSize = new Size((int)ii.Width, (int)ii.Height);
}
}
示例11: CreateBitmapFromIImage
private Bitmap CreateBitmapFromIImage(IImage image)
{
Bitmap result = null;
if (image != null)
{
ImageInfo ii;
image.GetImageInfo(out ii);
result = new Bitmap((int)ii.Width, (int)ii.Height);
using (Graphics gr = Graphics.FromImage(result))
{
IntPtr hdc = gr.GetHdc();
Rectangle rect = new Rectangle(0, 0, result.Width, result.Height);
image.Draw(hdc, ref rect, IntPtr.Zero);
gr.ReleaseHdc(hdc);
}
}
return result;
}