本文整理汇总了C#中System.Drawing.Image类的典型用法代码示例。如果您正苦于以下问题:C# Image类的具体用法?C# Image怎么用?C# Image使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Image类属于System.Drawing命名空间,在下文中一共展示了Image类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Apply
public override Image Apply(Image img)
{
using (img)
{
return ColorMatrixManager.Contrast(Value).Apply(img);
}
}
示例2: ScrollBarThumb
public ScrollBarThumb(ScrollBarThumbDefaults type)
{
this._imageAttributes = new ImageAttributes();
this._imageAttributes.ClearColorKey();
this._gripImageAttributes = new ImageAttributes();
this._gripImageAttributes.ClearColorKey();
switch (type)
{
case ScrollBarThumbDefaults.Normal:
this._color = SystemColors.ScrollBar;
this._gripColor = SystemColors.ControlText;
break;
case ScrollBarThumbDefaults.Highlight:
this._color = SystemColors.ControlText;
this._gripColor = SystemColors.HighlightText;
break;
}
this._borderStyle = ScrollBarBorderStyle.Solid;
this._borderColor = SystemColors.ControlText;
this._gradientColor = new Resco.Controls.ScrollBar.GradientColor(FillDirection.Horizontal);
this._gradientColor.PropertyChanged += new EventHandler(this.GradientColor_PropertyChanged);
this._image = null;
this._imageLayout = ScrollBarThumbImageLayout.Stretch;
this._imageTransparentColor = System.Drawing.Color.Transparent;
this._gripStyle = ScrollBarThumbGripStyle.Lines;
this._gripImage = null;
this._gripImageTransparentColor = System.Drawing.Color.Transparent;
this._gripLines = 3;
}
示例3: AojPrintPropertySystem
protected AojPrintPropertySystem(AojPrintPropertySystem propertySystem)
{
lock (new object())
{
this._id = propertySystem.Id;
this._x = propertySystem.X;
this._y = propertySystem.Y;
this._realX = propertySystem.RealX;
this._realY = propertySystem.RealY;
this._width = propertySystem.Width;
this._height = propertySystem.Height;
this._backgroundColor = propertySystem.BackgroundColor;
this._backgroundShape = propertySystem.BackgroundShape;
this._backgroundStyle = propertySystem.BackgroundStyle;
this._borderColor = propertySystem.BorderColor;
this._borderStyle = propertySystem.BorderStyle;
this._borderWidth = propertySystem.BorderWidth;
this._fontColor = propertySystem.FontColor;
this._fontDisplayFormat = propertySystem.FontDisplayFormat;
this._fontFamilyName = propertySystem.FontFamilyName;
this._fontSize = propertySystem.FontSize;
this._fontStyle = propertySystem.FontStyle;
this._src = propertySystem.Src;
this._imgPrint = propertySystem.ImgPrint;
this._imageMode = propertySystem.ImageMode;
this._alignment = propertySystem.Alignment;
this._value = propertySystem.Value;
this._viewFormat = propertySystem._viewFormat;
}
}
示例4: Apply
public override Image Apply(Image img)
{
using (img)
{
return ColorMatrixManager.ChangeGamma(img, Value);
}
}
示例5: Apply
public override Image Apply(Image img)
{
using (img)
{
return ColorMatrixManager.Grayscale(Value).Apply(img);
}
}
示例6: DStarLiteForm
public DStarLiteForm()
{
InitializeComponent();
My_D_Star_Lite = new D_Star_Lite();
My_D_Star_Lite.Initial(Map_column, Map_row);
New_Obstacle_List = new ArrayList();
Team_List = new ArrayList();
Alliance_List = new ArrayList();
Enemy_list = new ArrayList();
Get_Path = new ArrayList();
Obstacle_List = new ArrayList();
Updated_Nodes = new ArrayList();
Path = new ArrayList();
Map_Graphic = this.CreateGraphics();
Re_Open_Nodes = Properties.Resources.Circle;
Closed_Nodes = Properties.Resources.Circle_Cross;
Robot = Properties.Resources.Robot1;
New_Obs = Properties.Resources.RectangleWithCross;
Path_Node = Properties.Resources.Empty_Rec;
Round_Obstacle = Properties.Resources.Round;
Triangle_Obstacle = Properties.Resources.Triangle;
Target = Properties.Resources._5edge_Star;
Rect_Obstacle = Properties.Resources.Rec_Obs;
//mymap = new Grid_Map(Map_column, Map_row, 0, 0, Map_Graphic);
Map_Background = Properties.Resources.Background;
Map_Graphic.DrawImage(Map_Background, new Point(0, 0));
Move_Button.Enabled = false;
}
示例7: Apply
public override Image Apply(Image img)
{
using (img)
{
return ColorMatrixManager.Polaroid().Apply(img);
}
}
示例8: ImageToByteArray
public byte[] ImageToByteArray(Image imageIn, string imageFormatString)
{
var ms = new MemoryStream();
var imageFormat = getImageFormat(imageFormatString);
imageIn.Save(ms, imageFormat);
return ms.ToArray();
}
示例9: Resize
public static Image Resize(Image source, Size size)
{
int width = source.Width;
int height = source.Height;
float num3 = 0f;
float num4 = 0f;
float num5 = 0f;
num4 = ((float)size.Width) / ((float)width);
num5 = ((float)size.Height) / ((float)height);
if (num5 < num4)
{
num3 = num5;
}
else
{
num3 = num4;
}
int num6 = (int)(width * num3);
int num7 = (int)(height * num3);
Bitmap image = new Bitmap(num6, num7);
using (Graphics graphics = Graphics.FromImage(image))
{
graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
graphics.DrawImage(source, 0, 0, num6, num7);
}
return image;
}
示例10: Apply
public override Image Apply(Image img)
{
using (img)
{
return ColorMatrixManager.BlackWhite().Apply(img);
}
}
示例11: TriangleRegion
public TriangleRegion(Image backgroundImage = null)
: base(backgroundImage)
{
Angle = TriangleAngle.Top;
KeyDown += TriangleRegion_KeyDown;
}
示例12: ResizeImage
/// <summary>
/// resmi yeniden boyutlandır.
/// </summary>
/// <param name="imgToResize">boyutlandırılacak resim</param>
/// <param name="size">boyutlar</param>
/// <returns>Image titipnde bir resim</returns>
public static Image ResizeImage(Image imgToResize, Size size)
{
int sourceWidth = imgToResize.Width;
int sourceHeight = imgToResize.Height;
float nPercent = 0;
float nPercentW = 0;
float nPercentH = 0;
nPercentW = ((float)size.Width / (float)sourceWidth);
nPercentH = ((float)size.Height / (float)sourceHeight);
if (nPercentH < nPercentW)
nPercent = nPercentH;
else
nPercent = nPercentW;
int destWidth = (int)(sourceWidth * nPercent);
int destHeight = (int)(sourceHeight * nPercent);
Bitmap b = new Bitmap(destWidth, destHeight);
Graphics g = Graphics.FromImage((Image)b);
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
g.DrawImage(imgToResize, 0, 0, destWidth, destHeight);
g.Dispose();
imgToResize.Dispose();
return (Image)b;
}
示例13: ElementImageComparer
public ElementImageComparer(IPurpleElement element)
{
this.element = element;
CreateDirectory();
liveImage = GetLiveImage();
storedImage = GetStoredImage();
}
示例14: ResizeImage
public static Image ResizeImage(Image image, Size size, bool preserveAspectRatio = true)
{
int newWidth;
int newHeight;
if (preserveAspectRatio)
{
int originalWidth = image.Width;
int originalHeight = image.Height;
float percentWidth = size.Width / (float)originalWidth;
float percentHeight = size.Height / (float)originalHeight;
float percent = percentHeight < percentWidth ? percentHeight : percentWidth;
newWidth = (int)(originalWidth * percent);
newHeight = (int)(originalHeight * percent);
}
else
{
newWidth = size.Width;
newHeight = size.Height;
}
Image newImage = new Bitmap(newWidth, newHeight);
using (Graphics graphicsHandle = Graphics.FromImage(newImage))
{
graphicsHandle.InterpolationMode = InterpolationMode.HighQualityBicubic;
graphicsHandle.DrawImage(image, 0, 0, newWidth, newHeight);
}
return newImage;
}
示例15: Apply
public override Image Apply(Image img)
{
using (img)
{
return ConvolutionMatrixManager.EdgeDetect().Apply(img);
}
}