本文整理汇总了C#中MediaPortal.GUI.Library.GUIImage类的典型用法代码示例。如果您正苦于以下问题:C# GUIImage类的具体用法?C# GUIImage怎么用?C# GUIImage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GUIImage类属于MediaPortal.GUI.Library命名空间,在下文中一共展示了GUIImage类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
开发者ID:nio22,项目名称:MediaPortal-1,代码行数:7,代码来源:CachedTexture.cs
示例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);
}
}
开发者ID:pilehave,项目名称:headweb-mp,代码行数:13,代码来源:ImageElement.cs
示例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;
}
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:13,代码来源:GUIVideoControl.cs
示例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);
}
}
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:17,代码来源:GUIImageList.cs
示例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;
}
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:18,代码来源:GUIVerticalScrollbar.cs
示例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);
}
开发者ID:hkjensen,项目名称:MediaPortal-1,代码行数:75,代码来源:GUIRSSFeed.cs
示例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);
}
}
开发者ID:MediaPortal,项目名称:MediaPortal-1,代码行数:93,代码来源:GUIAnimation.cs
示例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);
}
开发者ID:nio22,项目名称:MediaPortal-1,代码行数:15,代码来源:GUIButtonControl.cs
示例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();
}
开发者ID:doskabouter,项目名称:MediaPortal-1,代码行数:25,代码来源:PlaneScene.cs
示例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;
}
开发者ID:nio22,项目名称:MediaPortal-1,代码行数:88,代码来源:GUIButton3PartControl.cs
示例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);
}
开发者ID:nio22,项目名称:MediaPortal-1,代码行数:15,代码来源:GUIButton3PartControl.cs
示例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);
}
}
开发者ID:doskabouter,项目名称:MediaPortal-1,代码行数:49,代码来源:GUIListControl.cs
示例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);
}
}
开发者ID:doskabouter,项目名称:MediaPortal-1,代码行数:56,代码来源:GUIListControl.cs
示例14: DisposeImage
private void DisposeImage(ref GUIImage image)
{
if (null == image) return;
image.SafeDispose();
image = null;
}
开发者ID:doskabouter,项目名称:MediaPortal-1,代码行数:7,代码来源:GUIListItem.cs
示例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;
}
开发者ID:MediaPortal,项目名称:MediaPortal-1,代码行数:12,代码来源:GUIAnimation.cs
示例16: RenderItem
//.........这里部分代码省略.........
_frameFocusControl.Focus = btn.Focus;
_frameFocusControl.SetPosition(btn._positionX, btn._positionY);
_frameFocusControl.Width = btn.Width;
_frameFocusControl.Height = btn.Height;
_frameFocusControl.Render(timePassed);
}
if (clipping)
{
GUIGraphicsContext.EndClip();
}
return;
}
if (fTextPosY >= _positionY && _renderUnfocusText)
{
_listLabels[iButton].XPosition = dwPosX + _textXOff;
_listLabels[iButton].YPosition = (int)Math.Truncate(fTextPosY + _textYOff);
_listLabels[iButton].Width = _textureWidth;
_listLabels[iButton].Height = _textureHeight;
_listLabels[iButton].TextColor = dwColor;
_listLabels[iButton].Label = pItem.Label;
_listLabels[iButton].AllowScrolling = false;
_listLabels[iButton].Render(timePassed);
}
}
// Set oversized value
int iOverSized = 0;
if (bFocus && Focus && _enableFocusZoom && _zoomXPixels == 0 && _zoomYPixels == 0)
{
iOverSized = (_thumbNailWidth + _thumbNailHeight) / THUMBNAIL_OVERSIZED_DIVIDER;
}
GUIImage pFocusImage = null;
if (pItem.HasThumbnail)
{
GUIImage pImage = pItem.Thumbnail;
pFocusImage = pImage;
if (null == pImage /*&& _sleeper==0 */&& !IsAnimating)
{
pImage = new GUIImage(0, 0, _xPositionThumbNail - iOverSized + dwPosX,
_yPositionThumbNail - iOverSized + dwPosY, _thumbNailWidth + 2 * iOverSized,
_thumbNailHeight + 2 * iOverSized, pItem.ThumbnailImage, 0x0);
if (pImage != null)
{
pImage.ParentControl = this;
pImage.KeepAspectRatio = _keepAspectRatio;
pImage.ImageAlignment = Alignment.ALIGN_CENTER;
pImage.ImageVAlignment = VAlignment.ALIGN_MIDDLE;
pImage.MaskFileName = _textureMask;
pImage.ZoomFromTop = !pItem.IsFolder && _zoom;
pImage.AllocResources();
pItem.Thumbnail = pImage;
pImage.SetPosition(_xPositionThumbNail - iOverSized + dwPosX, _yPositionThumbNail - iOverSized + dwPosY);
pImage.DimColor = DimColor;
if (bFocus || !Focus)
{
pImage.ColourDiffuse = 0xffffffff;
}
else
{
pImage.ColourDiffuse = Color.FromArgb(_unfocusedAlpha, Color.White).ToArgb();
}
if (bFocus && (_zoomXPixels != 0 || _zoomYPixels != 0))
{
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:67,代码来源:GUIThumbnailPanel.cs
示例17: AllocResources
public override void AllocResources()
{
try
{
if (GUIGraphicsContext.DX9Device == null)
{
return;
}
if (GUIGraphicsContext.DX9Device.Disposed)
{
return;
}
if (_registeredForEvent == false)
{
GUIPropertyManager.OnPropertyChanged -= GUIPropertyManager_OnPropertyChanged;
GUIPropertyManager.OnPropertyChanged += GUIPropertyManager_OnPropertyChanged;
_registeredForEvent = true;
}
_currentImage = 0;
_Info = 0;
_directoryLoaded = false;
_isAllocated = false;
_newPath = _texturePath;
Dispose();
base.AllocResources();
}
catch (Exception e)
{
Log.Error(e);
}
finally
{
_isAllocated = true;
}
if (!_directoryLoaded)
{
LoadDirectory();
}
// Randomize or sort our images if necessary
if (_randomized && _fileList.Count > 1)
{
Random_Shuffle(ref _fileList);
}
for (int i = 0; i < _fileList.Count; i++)
{
GUIImage pImage = new GUIImage(ParentID, GetID, _positionX, _positionY, _width, _height, _fileList[i], 0);
pImage.KeepAspectRatio = _keepAspectRatio;
_imageList.Add(pImage);
}
// Load in the current image, and reset our timer
_imageTimer.StartZero();
_fadeTimer.Stop();
_currentImage = 0;
if (_imageList.Count == 0)
{
return;
}
LoadImage(_currentImage);
_isAllocated = true;
}
开发者ID:nio22,项目名称:MediaPortal-1,代码行数:65,代码来源:GUIMultiImage.cs
示例18: SetBorderTFR
public void SetBorderTFR(string border, GUIImage.BorderPosition position, bool repeat, bool rotate,
string texture, long colorKey, bool hasCorners, bool cornerRotate)
{
_strBorderTFR = border;
_borderPositionTFR = position;
_borderTextureRepeatTFR = repeat;
_borderTextureRotateTFR = rotate;
_borderTextureFileNameTFR = texture;
_borderColorKeyTFR = colorKey;
_borderHasCornersTFR = hasCorners;
_borderCornerTextureRotateTFR = cornerRotate;
_imageFocusedRight.SetBorder(_strBorderTFR, _borderPositionTFR, _borderTextureRepeatTFR, _borderTextureRotateTFR,
_borderTextureFileNameTFR, _borderColorKeyTFR, _borderHasCornersTFR,
_borderCornerTextureRotateTFR);
}
开发者ID:nio22,项目名称:MediaPortal-1,代码行数:15,代码来源:GUIButton3PartControl.cs
示例19: LoadDirectory
public void LoadDirectory()
{
if (_directoryLoaded)
{
return;
}
// Unload any images from our texture bundle first
_fileList.Clear();
// Don't load any images if our path is empty
if (_newPath.Length == 0)
{
return;
}
// Check to see if we have a single image or a folder of images
if (MediaPortal.Util.Utils.IsPicture(_newPath))
{
_fileList.Add(_newPath);
}
else
{
// Folder of images
try
{
string imageFolder = string.Empty;
// Try to use the provided folder as an absolute path
if (Directory.Exists(_newPath) && Path.IsPathRooted(_newPath))
{
imageFolder = _newPath;
}
// If that didnt work, try to use relative pathing into the skin\Media folder
if (imageFolder.Trim().Length == 0)
{
//Log.Debug("GUIMultiImage - try relative pathing: " + GUIGraphicsContext.GetThemedSkinDirectory(@"\Media\animations\" + _newPath));
imageFolder = GUIGraphicsContext.GetThemedSkinDirectory(@"\Media\animations\" + _newPath);
// If the folder doesnt exist, we have an invalid field, exit
if (!Directory.Exists(imageFolder))
{
return;
}
}
// Load the image files
string[] files = Directory.GetFiles(imageFolder);
for (int i = 0; i < files.Length; ++i)
{
if (MediaPortal.Util.Utils.IsPicture(files[i]))
{
_fileList.Add(files[i]);
}
}
}
// If there was some other error accessing the folder, exit
catch (UnauthorizedAccessException)
{
return;
}
catch (IOException)
{
return;
}
}
// Randomize or sort our images if necessary
if (_randomized && _fileList.Count > 1)
{
Random_Shuffle(ref _fileList);
}
// flag as loaded - no point in antly reloading them
_directoryLoaded = true;
for (int i = 0; i < _fileList.Count; i++)
{
GUIImage pImage = new GUIImage(ParentID, GetID, _positionX, _positionY, _width, _height, _fileList[i], 0);
pImage.KeepAspectRatio = _keepAspectRatio;
_imageList.Add(pImage);
}
// Load in the current image, and reset our timer
_imageTimer.StartZero();
_fadeTimer.Stop();
_currentImage = 0;
if (_imageList.Count == 0)
{
return;
}
//LoadImage(_currentImage);
_isAllocated = true;
}
开发者ID:nio22,项目名称:MediaPortal-1,代码行数:94,代码来源:GUIMultiImage.cs
示例20: GUIButton3PartControl
/// <summary>
/// The constructor of the GUIButton3PartControl class.
/// </summary>
/// <param name="dwParentID">The parent of this control.</param>
/// <param name="dwControlId">The ID of this control.</param>
/// <param name="dwPosX">The X position of this control.</param>
/// <param name="dwPosY">The Y position of this control.</param>
/// <param name="dwWidth">The width of this control.</param>
/// <param name="dwHeight">The height of this control.</param>
/// <param name="strTextureFocus">The filename containing the texture of the butten, when the button has the focus.</param>
/// <param name="strTextureNoFocus">The filename containing the texture of the butten, when the button does not have the focus.</param>
public GUIButton3PartControl(int dwParentID, int dwControlId, int dwPosX, int dwPosY, int dwWidth, int dwHeight,
string strTextureFocusLeft,
string strTextureFocusMid,
string strTextureFocusRight,
string strTextureNoFocusLeft,
string strTextureNoFocusMid,
string strTextureNoFocusRight,
string strTextureIcon)
: base(dwParentID, dwControlId, dwPosX, dwPosY, dwWidth, dwHeight)
{
_textureFocusedLeft = strTextureFocusLeft;
_textureFocusedMid = strTextureFocusMid;
_textureFocusedRight = strTextureFocusRight;
_textureNonFocusedLeft = strTextureNoFocusLeft;
_textureNonFocusedMid = strTextureNoFocusMid;
_textureNonFocusedRight = strTextureNoFocusRight;
_textureIcon = strTextureIcon;
_textureIcon2 = strTextureIcon;
_imageIcon = new GUIImage(dwParentID, dwControlId, dwPosX, dwPosY, 0, 0, strTextureIcon, 0);
_imageIcon2 = new GUIImage(dwParentID, dwControlId, dwPosX, dwPosY, 0, 0, strTextureIcon, 0);
_imageFocusedLeft = new GUIImage(dwParentID, dwControlId, dwPosX, dwPosY, dwWidth, dwHeight, strTextureFocusLeft,
0);
_imageFocusedMid = new GUIImage(dwParentID, dwControlId, dwPosX, dwPosY, dwWidth, dwHeight, strTextureFocusMid, 0);
_imageFocusedRight = new GUIImage(dwParentID, dwControlId, dwPosX, dwPosY, dwWidth, dwHeight, strTextureFocusRight,
0);
_imageNonFocusedLeft = new GUIImage(dwParentID, dwControlId, dwPosX, dwPosY, dwWidth, dwHeight,
strTextureNoFocusLeft, 0);
_imageNonFocusedMid = new GUIImage(dwParentID, dwControlId, dwPosX, dwPosY, dwWidth, dwHeight,
strTextureNoFocusMid, 0);
_imageNonFocusedRight = new GUIImage(dwParentID, dwControlId, dwPosX, dwPosY, dwWidth, dwHeight,
strTextureNoFocusRight, 0);
_isSelected = false;
_labelControl1 = new GUILabelControl(dwParentID);
_labelControl2 = new GUILabelControl(dwParentID);
_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;
_imageFocusedLeft.OverlayFileName = _overlayTFL;
_imageFocusedMid.OverlayFileName = _overlayTFM;
_imageFocusedRight.OverlayFileName = _overlayTFR;
_imageNonFocusedLeft.OverlayFileName = _overlayTNFL;
_imageNonFocusedMid.OverlayFileName = _overlayTNFM;
_imageNonFocusedRight.OverlayFileName = _overlayTNFR;
_imageIcon2.Visible = false; // Constructor creates icon2 as a copy of icon1.
}
开发者ID:nio22,项目名称:MediaPortal-1,代码行数:76,代码来源:GUIButton3PartControl.cs
注:本文中的MediaPortal.GUI.Library.GUIImage类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论