--- mythtv_original/mythtv/libs/libmythui/mythuiimage.cpp	2011-12-04 19:13:10.514095116 +0100
+++ mythtv/mythtv/libs/libmythui/mythuiimage.cpp	2011-12-04 19:12:28.281885693 +0100
@@ -321,6 +321,11 @@
 
     m_isGreyscale = false;
 
+    m_isRotated = false;
+    m_rotationAngle = 0;
+    m_isZoomed = false;
+    m_zoomPercent = 0;
+
     m_preserveAspect = false;
 
     m_animationCycle = kCycleStart;
@@ -425,6 +430,12 @@
     if (m_isGreyscale && !img->isGrayscale())
         img->ToGreyscale();
 
+    if (m_isRotated && !img->IsRotated() && m_rotationAngle != 0)
+        img->Rotate(m_rotationAngle, m_ForceSize);
+
+    if (m_isZoomed && !img->IsZoomed() && m_zoomPercent != 0)
+        img->Zoom(m_zoomPercent);
+
     if (m_ForceSize.isNull())
         SetSize(img->size());
 
@@ -481,6 +492,12 @@
         if (m_isGreyscale && !im->isGrayscale())
             im->ToGreyscale();
 
+        if (m_isRotated && !im->IsRotated() && m_rotationAngle != 0)
+            im->Rotate(m_rotationAngle, m_ForceSize);
+
+        if (m_isZoomed && !im->IsZoomed() && m_zoomPercent != 0)
+            im->Zoom(m_zoomPercent);
+
         m_ImagesLock.lock();
         m_Images[m_Images.size()] = im;
         m_ImagesLock.unlock();
@@ -520,6 +537,34 @@
 }
 
 /**
+ *  \brief Rotates the first image in the widget
+ */
+void MythUIImage::SetRotation(int rotationAngle)
+{
+    LOG(VB_GENERAL, LOG_INFO,
+        QString("Rotating image %1 by %2")
+        .arg(m_Filename)
+        .arg(rotationAngle));
+
+    m_isRotated = true;
+    m_rotationAngle = rotationAngle;
+}
+
+/**
+ *  \brief Zooms the first image in the widget
+ */
+void MythUIImage::SetZoom(int zoomPercent)
+{
+    LOG(VB_GENERAL, LOG_INFO,
+        QString("Zooming image %1 by %2")
+        .arg(m_Filename)
+        .arg(zoomPercent));
+
+    m_isZoomed = true;
+    m_zoomPercent = zoomPercent;
+}
+
+/**
  *  \brief Set the size of the widget
  */
 void MythUIImage::SetSize(int width, int height)
@@ -576,6 +621,18 @@
     if (m_isGreyscale)
         s_Attrib += "greyscale";
 
+    if (m_isRotated)
+    {
+        s_Attrib += "rotated";
+        s_Attrib += QString("%1").arg(m_rotationAngle);
+    }
+
+    if (m_isZoomed)
+    {
+        s_Attrib += "zoomed";
+        s_Attrib += QString("%1").arg(m_zoomPercent);
+    }
+
     imagelabel  = QString("%1-%2-%3x%4.png")
                   .arg(filename)
                   .arg(s_Attrib)
@@ -814,6 +871,12 @@
         if (m_isReflected)
             image->setIsReflected(true);
 
+        if (m_isRotated)
+            image->setIsRotated(true);
+
+        if (m_isZoomed)
+            image->setIsZoomed(true);
+
         QRect rect(GetFullArea());
         rect.setSize(image->size());
         SetMinArea(rect);
@@ -892,6 +955,12 @@
         if (m_isGreyscale)
             image->ToGreyscale();
 
+        if (m_isRotated)
+            image->Rotate(m_rotationAngle, m_ForceSize);
+
+        if (m_isZoomed)
+            image->Zoom(m_zoomPercent);
+
         if (!imageReader.supportsAnimation())
             GetMythUI()->CacheImage(imagelabel, image);
     }
@@ -1146,6 +1215,26 @@
         if (x > 0 || y > 0)
             area.translate(x, y);
 
+        // The image is already centered on the screen. But if the
+        // image is zoomed its size could be larger than the screen. In
+        // this case the area needs to be centered within the screen area.
+        if (m_isZoomed && m_zoomPercent > 0)
+        {
+            // Get the dimensions (x- and y-resolution) of the screen.
+            int screenWidth, screenHeight;
+            float screenWidthMult, screenHeightMult;
+            GetMythUI()->GetScreenSettings(screenWidth, screenWidthMult,
+                                           screenHeight, screenHeightMult);
+
+            if (area.width() > screenWidth)
+                x = (screenWidth - area.width()) / 2;
+
+            if (area.height() > screenHeight)
+                y = (screenHeight - area.height()) / 2;
+
+            area.translate(x, y);
+        }
+
         QRect srcRect;
         m_cropRect.CalculateArea(GetFullArea());
 
@@ -1329,6 +1418,22 @@
     {
         m_isGreyscale = parseBool(element);
     }
+    else if (element.tagName() == "rotate")
+    {
+        m_isRotated = true;
+        QString tmp = element.attribute("angle");
+
+        if (!tmp.isEmpty())
+            m_rotationAngle = tmp.toInt();
+    }
+    else if (element.tagName() == "zoom")
+    {
+        m_isZoomed = true;
+        QString tmp = element.attribute("percent");
+
+        if (!tmp.isEmpty())
+            m_zoomPercent = tmp.toInt();
+    }
     else
     {
         return MythUIType::ParseElement(filename, element, showWarnings);
@@ -1387,6 +1492,12 @@
 
     m_isGreyscale = im->m_isGreyscale;
 
+    m_isRotated = im->m_isRotated;
+    m_isZoomed = im->m_isZoomed;
+
+    m_rotationAngle = im->m_rotationAngle;
+    m_zoomPercent = im->m_zoomPercent;
+
     m_animationCycle = im->m_animationCycle;
     m_animatedImage = im->m_animatedImage;
 
--- mythtv_original/mythtv/libs/libmythui/mythuiimage.h	2011-12-04 19:13:10.514095116 +0100
+++ mythtv/mythtv/libs/libmythui/mythuiimage.h	2011-11-13 20:46:54.960713478 +0100
@@ -59,6 +59,9 @@
 
     virtual void LoadNow(void);
 
+    void SetZoom(int zoomPercent);
+    void SetRotation(int rotationAngle);
+
   protected:
     virtual void DrawSelf(MythPainter *p, int xoffset, int yoffset,
                           int alphaMod, QRect clipRect);
@@ -119,6 +122,11 @@
     int  m_reflectLength;
     int  m_reflectSpacing;
 
+    bool m_isRotated;
+    int m_rotationAngle;
+    bool m_isZoomed;
+    int m_zoomPercent;
+
     MythImage *m_maskImage;
     bool m_isMasked;
 
--- mythtv_original/mythtv/libs/libmythui/mythimage.cpp	2011-12-04 19:13:10.486094970 +0100
+++ mythtv/mythtv/libs/libmythui/mythimage.cpp	2011-12-04 19:12:28.277885683 +0100
@@ -41,6 +41,8 @@
     m_gradAlpha = 255;
     m_gradDirection = FillTopToBottom;
 
+    m_isZoomed = false;
+    m_isRotated = false;
     m_isReflected = false;
     m_isYUV = false;
 
@@ -124,6 +126,43 @@
     Assign(pix.toImage());
 }
 
+void MythImage::Rotate(int rotationAngle, QSize size)
+{
+    if (m_isRotated)
+        return;
+
+    QMatrix matrix;
+    matrix.rotate(rotationAngle);
+    Assign(transformed(matrix, Qt::SmoothTransformation));
+
+    // The rotated image is higher than the parent area
+    // the image needs to be resized to be with the areas dimensions
+
+    // TODO: If the image is rotated not by multiple of 90 degrees
+    //       calculate the new dimensions by using the pythagoras
+    if (!size.isNull())
+    {
+        Resize(size, true);
+    }
+
+    m_isRotated = true;
+}
+
+void MythImage::Zoom(int zoomPercent)
+{
+    if (m_isZoomed)
+        return;
+
+    float factor = (100.0 + zoomPercent) / 100.0;
+    int newWidth = (int)(width() * factor);
+    int newHeight = (int)(height() * factor);
+
+    Assign(scaled(QSize(newWidth, newHeight),
+                  Qt::KeepAspectRatio, Qt::SmoothTransformation));
+
+    m_isZoomed = true;
+}
+
 void MythImage::Resize(const QSize &newSize, bool preserveAspect)
 {
     if ((size() == newSize) && !isNull())
--- mythtv_original/mythtv/libs/libmythui/mythimage.h	2011-08-04 15:19:01.273800195 +0200
+++ mythtv/mythtv/libs/libmythui/mythimage.h	2011-12-04 19:12:28.277885683 +0100
@@ -44,6 +44,8 @@
 
     bool IsGradient() const { return m_isGradient; }
     bool IsReflected() const { return m_isReflected; }
+    bool IsRotated() const { return m_isRotated; }
+    bool IsZoomed() const { return m_isZoomed; }
 
     void SetToYUV(void) { m_isYUV = true; }
     void ConvertToYUV(void);
@@ -54,6 +56,8 @@
     bool Load(MythImageReader &reader);
     bool Load(const QString &filename, bool scale = true);
 
+    void Rotate(int rotationAngle, QSize size);
+    void Zoom(int zoomPercent);
     void Resize(const QSize &newSize, bool preserveAspect = false);
     void Reflect(ReflectAxis axis, int shear, int scale, int length,
                  int spacing = 0);
@@ -78,6 +82,8 @@
     QString GetFileName(void) const { return m_FileName; }
 
     void setIsReflected(bool reflected) { m_isReflected = reflected; }
+    void setIsRotated(bool rotated) { m_isRotated = rotated; }
+    void setIsZoomed(bool zoomed) { m_isZoomed = zoomed; }
 
     void SetIsInCache(bool bCached);
 
@@ -100,6 +106,8 @@
     int m_gradAlpha;
     FillDirection m_gradDirection;
 
+    bool m_isRotated;
+    bool m_isZoomed;
     bool m_isReflected;
     bool m_isYUV;
 
