本文整理汇总了C#中MediaPortal.GUI.Library.GUIImage类的典型用法代码示例。如果您正苦于以下问题:C# GUIImage类的具体用法?C# GUIImage怎么用?C# GUIImage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GUIImage类属于MediaPortal.GUI.Library命名空间,在下文中一共展示了GUIImage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FontEngineDrawTexture2
private static extern unsafe void FontEngineDrawTexture2(int textureNo1, float x, float y, float nw, float nh,
float uoff, float voff, float umax, float vmax,
int color,
float[,] matrix, int textureNo2, float uoff2,
float voff2,
float umax2, float vmax2,
GUIImage.FontEngineBlendMode blendMode);
示例2: ImageElement
/// <summary>
/// Creates the element and retrieves all information from the control
/// </summary>
/// <param name="control">GUIControl</param>
public ImageElement(GUIControl control)
: base(control)
{
_image = control as GUIImage;
if (_image != null)
{
_bitmap = loadBitmap(_image.FileName);
}
}
示例3: FinalizeConstruction
public override void FinalizeConstruction()
{
base.FinalizeConstruction();
_imageFocusRectangle = LoadAnimationControl(_parentControlId, _controlId, _positionX, _positionY, _width, _height,
_focusedTextureName);
thumbImage = new GUIImage(_parentControlId, _controlId, _positionX, _positionY, _width, _height,
"#Play.Current.Thumb", 1);
blackImage = new GUIImage(_parentControlId, _controlId, _positionX, _positionY, _width, _height, "black.png", 1);
_imageFocusRectangle.ParentControl = this;
thumbImage.ParentControl = this;
blackImage.ParentControl = this;
}
示例4: FinalizeConstruction
public override void FinalizeConstruction()
{
base.FinalizeConstruction();
GUIGraphicsContext.ScaleHorizontal(ref _textureWidth);
GUIGraphicsContext.ScaleVertical(ref _textureHeight);
for (int i = 0; i < SubItemCount; ++i)
{
string strTexture = (string)GetSubItem(i);
GUIImage img = new GUIImage(_parentControlId, _controlId, _positionX, _positionY, _textureWidth, _textureHeight,
strTexture, 0);
img.ParentControl = this;
img.DimColor = DimColor;
_itemList.Add(img);
}
}
示例5: FinalizeConstruction
public override void FinalizeConstruction()
{
base.FinalizeConstruction();
_imageBackground = new GUIImage(_parentControlId, _controlId, _positionX, _positionY, _width, _height,
_scrollbarBackgroundName, 0);
_imageTop = new GUIImage(_parentControlId, _controlId, _positionX, _positionY, _width, _height,
_scrollbarTopTextureName, 0);
_imageBottom = new GUIImage(_parentControlId, _controlId, _positionX, _positionY, _width, _height,
_scrollbarBottomTextureName, 0);
_imageBackground.ParentControl = this;
_imageTop.ParentControl = this;
_imageBottom.ParentControl = this;
_imageBackground.DimColor = DimColor;
_imageTop.DimColor = DimColor;
_imageBottom.DimColor = DimColor;
}
示例6: OnMessage
public override bool OnMessage(GUIMessage message)
{
switch (message.Message)
{
case GUIMessage.MessageType.GUI_MSG_WINDOW_INIT:
{
for (int j = 0; j < NUM_STORIES; j++)
{
m_feed_details[j].m_site = "";
m_feed_details[j].m_title = "";
m_feed_details[j].m_description = "";
}
base.OnMessage(message);
LoadSettings();
m_pSiteImage = (GUIImage)GetControl((int)Controls.CONTROL_IMAGELOGO);
UpdateNews(true);
return true;
}
case GUIMessage.MessageType.GUI_MSG_WINDOW_DEINIT:
{
SaveSettings();
}
break;
case GUIMessage.MessageType.GUI_MSG_ITEM_FOCUS_CHANGED:
{
int iControl = message.SenderControlId;
if (iControl == (int)Controls.CONTROL_LIST)
{
UpdateDetails();
}
}
break;
case GUIMessage.MessageType.GUI_MSG_CLICKED:
{
int iControl = message.SenderControlId;
if (iControl == (int)Controls.CONTROL_BTNREFRESH)
{
UpdateNews(true);
}
if (iControl == (int)Controls.CONTROL_LIST)
{
String story = DownloadMainStory();
if (story != null)
{
GUIDialogText dlg = (GUIDialogText)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_TEXT);
if (dlg != null)
{
dlg.Reset();
dlg.ResetAllControls();
dlg.SetHeading("Story");
dlg.SetText(story);
dlg.DoModal(GetID);
}
}
}
if (iControl == (int)Controls.CONTROL_BTNCHANNEL)
{
OnSelectFeed();
return true;
}
}
break;
}
return base.OnMessage(message);
}
示例7: AllocResources
public override void AllocResources()
{
Dispose();
using (Settings xmlreader = new MPSettings())
{
_hidePngAnimations = (xmlreader.GetValueAsBool("general", "hidepnganimations", false));
}
if (_filenames == null)
{
_filenames = new ArrayList();
foreach (string filename in _textureNames.Split(';'))
{
if (filename.IndexOfAny(new char[] {'?', '*'}) != -1)
{
foreach (string match in Directory.GetFiles(GUIGraphicsContext.GetThemedSkinFile(@"\media\" + filename)))
{
_filenames.Add(Path.GetFileName(match));
}
}
else
{
_filenames.Add(filename.Trim());
}
}
}
_images = new GUIImage[_filenames.Count];
int w = 0;
int h = 0;
if (_images != null)
{
for (int index = 0; index < _images.Length; index++)
{
_imageId++;
_images[index] = new GUIImage(ParentID, _imageId + index, 0, 0, Width, Height, (string) _filenames[index], 0);
_images[index].ParentControl = this;
_images[index].ColourDiffuse = ColourDiffuse;
_images[index].DimColor = DimColor;
_images[index].KeepAspectRatio = _keepAspectRatio;
_images[index].Filtering = Filtering;
_images[index].RepeatBehavior = _repeatBehavior;
_images[index].DiffuseFileName = _diffuseFileName;
_images[index].MaskFileName = _maskFileName;
_images[index].OverlayFileName = _overlayFileName;
_images[index].FlipX = _flipX;
_images[index].FlipY = _flipY;
_images[index].SetBorder(_strBorder, _borderPosition, _borderTextureRepeat,
_borderTextureRotate, _borderTextureFileName, _borderColorKey, _borderHasCorners,
_borderCornerTextureRotate);
_images[index].TileFill = _tileFill;
_images[index].AllocResources();
//_images[index].ScaleToScreenResolution(); -> causes too big images in fullscreen
if (_images.Length > index) w = Math.Max(w, _images[index].Width);
if (_images.Length > index) h = Math.Max(h, _images[index].Height);
if (_images.Length > index) _renderWidth = Math.Max(_renderWidth, _images[index].RenderWidth);
if (_images.Length > index) _renderHeight = Math.Max(_renderHeight, _images[index].RenderHeight);
if (_images.Length > index) _textureWidth = Math.Max(_textureWidth, _images[index].TextureWidth);
if (_images.Length > index) _textureHeight = Math.Max(_textureHeight, _images[index].TextureHeight);
}
}
int x = _positionX;
int y = _positionY;
if (_horizontalAlignment == HorizontalAlignment.Center)
{
x = x - (w / 2);
}
else if (_horizontalAlignment == HorizontalAlignment.Right)
{
x = x - w;
}
if (_verticalAlignment == VerticalAlignment.Center)
{
y = y - (h / 2);
}
else if (_verticalAlignment == VerticalAlignment.Bottom)
{
y = y - h;
}
for (int index = 0; index < _images.Length; index++)
{
_images[index].SetPosition(x, y);
}
}
示例8: SetBorderTNF
public void SetBorderTNF(string border, GUIImage.BorderPosition position, bool repeat, bool rotate,
string texture, long colorKey, bool hasCorners, bool cornerRotate)
{
_strBorderTNF = border;
_borderPositionTNF = position;
_borderTextureRepeatTNF = repeat;
_borderTextureRotateTNF = rotate;
_borderTextureFileNameTNF = texture;
_borderColorKeyTNF = colorKey;
_borderHasCornersTNF = hasCorners;
_borderCornerTextureRotateTNF = cornerRotate;
_imageNonFocused.SetBorder(_strBorderTNF, _borderPositionTNF, _borderTextureRepeatTNF, _borderTextureRotateTNF,
_borderTextureFileNameTNF, _borderColorKeyTNF, _borderHasCornersTNF,
_borderCornerTextureRotateTNF);
}
示例9: PlaneScene
public PlaneScene(VMR9Util util)
{
// Log.Info("PlaneScene: ctor()");
_textureAddress = 0;
_vmr9Util = util;
// Number of vertex buffers must be same as numer of segments in non-linear stretch
_vertexBuffers = new VertexBuffer[nlsSourcePartitioning.Length];
for (int i = 0; i < _vertexBuffers.Length; i++)
{
_vertexBuffers[i] = new VertexBuffer(typeof (CustomVertex.TransformedColoredTextured),
4,
GUIGraphicsContext.DX9Device,
0,
CustomVertex.TransformedColoredTextured.Format,
GUIGraphicsContext.GetTexturePoolType());
}
_blackImage = new GUIImage(0);
_blackImage.SetFileName("black.png");
_blackImage.AllocResources();
_cropSettings = new CropSettings();
}
示例10: FinalizeConstruction
/// <summary>
/// This method gets called when the control is created and all properties has been set
/// It allows the control todo any initialization
/// </summary>
public override void FinalizeConstruction()
{
base.FinalizeConstruction();
_imageIcon = new GUIImage(ParentID, GetID, _positionX, _positionY, 0, 0, _textureIcon, 0);
_imageIcon2 = new GUIImage(ParentID, GetID, _positionX, _positionY, 0, 0, _textureIcon2, 0);
_imageFocusedLeft = new GUIImage(ParentID, GetID, _positionX, _positionY, Width, Height, _textureFocusedLeft, 0);
_imageFocusedMid = new GUIImage(ParentID, GetID, _positionX, _positionY, Width, Height, _textureFocusedMid, 0);
_imageFocusedRight = new GUIImage(ParentID, GetID, _positionX, _positionY, Width, Height, _textureFocusedRight, 0);
_imageNonFocusedLeft = new GUIImage(ParentID, GetID, _positionX, _positionY, Width, Height, _textureNonFocusedLeft,
0);
_imageNonFocusedMid = new GUIImage(ParentID, GetID, _positionX, _positionY, Width, Height, _textureNonFocusedMid,
0);
_imageNonFocusedRight = new GUIImage(ParentID, GetID, _positionX, _positionY, Width, Height,
_textureNonFocusedRight, 0);
_isSelected = false;
_labelControl1 = new GUILabelControl(ParentID);
_labelControl2 = new GUILabelControl(ParentID);
_imageIcon.ParentControl = this;
_imageIcon2.ParentControl = this;
_imageFocusedLeft.ParentControl = this;
_imageFocusedMid.ParentControl = this;
_imageFocusedRight.ParentControl = this;
_imageNonFocusedLeft.ParentControl = this;
_imageNonFocusedMid.ParentControl = this;
_imageNonFocusedRight.ParentControl = this;
_labelControl1.ParentControl = this;
_labelControl2.ParentControl = this;
_imageFocusedLeft.DimColor = DimColor;
_imageFocusedMid.DimColor = DimColor;
_imageFocusedRight.DimColor = DimColor;
_imageNonFocusedLeft.DimColor = DimColor;
_imageNonFocusedMid.DimColor = DimColor;
_imageNonFocusedRight.DimColor = DimColor;
_imageIcon.DimColor = DimColor;
_imageIcon2.DimColor = DimColor;
_labelControl1.DimColor = DimColor;
_labelControl2.DimColor = DimColor;
_labelControl1.SetShadow(_shadowAngle1, _shadowDistance1, _shadowColor1);
_labelControl2.SetShadow(_shadowAngle2, _shadowDistance2, _shadowColor2);
_imageFocusedLeft.SetBorder(_strBorderTFL, _borderPositionTFL, _borderTextureRepeatTFL, _borderTextureRotateTFL,
_borderTextureFileNameTFL, _borderColorKeyTFL, _borderHasCornersTFL,
_borderCornerTextureRotateTFL);
_imageNonFocusedLeft.SetBorder(_strBorderTNFL, _borderPositionTNFL, _borderTextureRepeatTNFL,
_borderTextureRotateTNFL,
_borderTextureFileNameTNFL, _borderColorKeyTNFL, _borderHasCornersTNFL,
_borderCornerTextureRotateTNFL);
_imageFocusedMid.SetBorder(_strBorderTFM, _borderPositionTFM, _borderTextureRepeatTFM, _borderTextureRotateTFM,
_borderTextureFileNameTFM, _borderColorKeyTFM, _borderHasCornersTFM,
_borderCornerTextureRotateTFM);
_imageNonFocusedMid.SetBorder(_strBorderTNFM, _borderPositionTNFM, _borderTextureRepeatTNFM,
_borderTextureRotateTNFM,
_borderTextureFileNameTNFM, _borderColorKeyTNFM, _borderHasCornersTNFM,
_borderCornerTextureRotateTNFM);
_imageFocusedRight.SetBorder(_strBorderTFR, _borderPositionTFR, _borderTextureRepeatTFR, _borderTextureRotateTFR,
_borderTextureFileNameTFR, _borderColorKeyTFR, _borderHasCornersTFR,
_borderCornerTextureRotateTFR);
_imageNonFocusedRight.SetBorder(_strBorderTNFR, _borderPositionTNFR, _borderTextureRepeatTNFR,
_borderTextureRotateTNFR,
_borderTextureFileNameTNFR, _borderColorKeyTNFR, _borderHasCornersTNFR,
_borderCornerTextureRotateTNFR);
_imageIcon.SetBorder(_strBorderTI, _borderPositionTI, _borderTextureRepeatTI, _borderTextureRotateTI,
_borderTextureFileNameTI, _borderColorKeyTI, _borderHasCornersTI,
_borderCornerTextureRotateTI);
_imageIcon2.SetBorder(_strBorderTI2, _borderPositionTI2, _borderTextureRepeatTI2, _borderTextureRotateTI2,
_borderTextureFileNameTI2, _borderColorKeyTI2, _borderHasCornersTI2,
_borderCornerTextureRotateTI2);
TileFillTFL = _textureFocusedLeftTileFill;
TileFillTNFL = _textureNonFocusedLeftTileFill;
TileFillTFM = _textureFocusedMidTileFill;
TileFillTNFM = _textureNonFocusedMidTileFill;
TileFillTFR = _textureFocusedRightTileFill;
TileFillTNFR = _textureNonFocusedRightTileFill;
}
示例11: SetBorderTI2
public void SetBorderTI2(string border, GUIImage.BorderPosition position, bool repeat, bool rotate,
string texture, long colorKey, bool hasCorners, bool cornerRotate)
{
_strBorderTI2 = border;
_borderPositionTI2 = position;
_borderTextureRepeatTI2 = repeat;
_borderTextureRotateTI2 = rotate;
_borderTextureFileNameTI2 = texture;
_borderColorKeyTI2 = colorKey;
_borderHasCornersTI2 = hasCorners;
_borderCornerTextureRotateTI2 = cornerRotate;
_imageIcon2.SetBorder(_strBorderTI2, _borderPositionTI2, _borderTextureRepeatTI2, _borderTextureRotateTI2,
_borderTextureFileNameTI2, _borderColorKeyTI2, _borderHasCornersTI2,
_borderCornerTextureRotateTI2);
}
示例12: RenderPinIcon
protected virtual void RenderPinIcon(float timePassed, int buttonNr, int x, int y, bool gotFocus)
{
GUIListItem pItem = _listItems[buttonNr + _offset];
if (pItem.HasPinIcon)
{
GUIImage pinImage = pItem.PinIcon;
if (null == pinImage)
{
//pinImage = new GUIImage(0, 0, 0, 0, 0, 0, pItem.PinImage, 0x0);
pinImage = new GUIImage(0, 0, 0, 0, _widthPinIcon, _heightPinIcon, pItem.PinImage, 0x0)
{
ParentControl = this,
KeepAspectRatio = _keepAspectRatio
};
pinImage.AllocResources();
pItem.PinIcon = pinImage;
}
pinImage.KeepAspectRatio = _keepAspectRatio;
pinImage.Width = PinIconWidth;
pinImage.Height = PinIconHeight;
if (PinIconOffsetY < 0 || PinIconOffsetX < 0)
{
pinImage.SetPosition(x + (_width) - (pinImage.TextureWidth + pinImage.TextureWidth / 2),
y + (_height / 2) - (pinImage.TextureHeight / 2));
}
else
{
pinImage.SetPosition(x + PinIconOffsetX, y + PinIconOffsetY);
}
if (gotFocus || !Focus)
{
pinImage.ColourDiffuse = 0xffffffff;
}
else
{
pinImage.ColourDiffuse = Color.FromArgb(_unfocusedAlpha, Color.White).ToArgb();
}
if (!pItem.Selected && !gotFocus && _unfocusedAlphaApplyToAll)
{
pinImage.ColourDiffuse = Color.FromArgb(_unfocusedAlpha, Color.White).ToArgb();
}
pinImage.DimColor = DimColor;
pinImage.Render(timePassed);
}
}
示例13: RenderIcon
protected virtual void RenderIcon(float timePassed, int buttonNr, int x, int y, bool gotFocus)
{
GUIListItem pItem = _listItems[buttonNr + _offset];
if (pItem.HasIcon)
{
if (MediaPortal.Util.Utils.FileExistsInCache(pItem.ThumbnailImage))
{
pItem.IconImage = pItem.ThumbnailImage;
}
// show icon
GUIImage pImage = pItem.Icon;
if (null == pImage)
{
pImage = new GUIImage(0, 0, 0, 0, _imageWidth, _imageHeight, pItem.IconImage, 0x0)
{
ParentControl = this,
KeepAspectRatio = _keepAspectRatio
};
pImage.AllocResources();
pItem.Icon = pImage;
}
if (pImage.TextureHeight == 0 && pImage.TextureWidth == 0)
{
pImage.SafeDispose();
pImage = new GUIImage(0, 0, 0, 0, _imageWidth, _imageHeight, pItem.IconImage, 0x0)
{
ParentControl = this,
KeepAspectRatio = _keepAspectRatio
};
pImage.AllocResources();
pItem.Icon = pImage;
//pImage.AllocResources();
}
pImage.KeepAspectRatio = _keepAspectRatio;
pImage.Width = _imageWidth;
pImage.Height = _imageHeight;
pImage.SetPosition(x, y);
if (gotFocus || !Focus)
{
pImage.ColourDiffuse = 0xffffffff;
}
else
{
pImage.ColourDiffuse = Color.FromArgb(_unfocusedAlpha, Color.White).ToArgb();
}
if (!pItem.Selected && !gotFocus && _unfocusedAlphaApplyToAll)
{
pImage.ColourDiffuse = Color.FromArgb(_unfocusedAlpha, Color.White).ToArgb();
}
pImage.DimColor = DimColor;
pImage.Render(timePassed);
}
}
示例14: DisposeImage
private void DisposeImage(ref GUIImage image)
{
if (null == image) return;
image.SafeDispose();
image = null;
}
示例15: SetBorder
public void SetBorder(string border, GUIImage.BorderPosition position, bool textureRepeat, bool textureRotate,
string textureFilename, long colorKey, bool hasCorners, bool cornerTextureRotate)
{
_strBorder = border;
_borderPosition = position;
_borderTextureRepeat = textureRepeat;
_borderTextureRotate = textureRotate;
_borderTextureFileName = textureFilename;
_borderColorKey = colorKey;
_borderHasCorners = hasCorners;
_borderCornerTextureRotate = cornerTextureRotate;
}