コード例 #1
0
 /// <summary>
 /// Sets layout mode of device.
 /// </summary>
 /// <param name="layout">Layout to set.</param>
 /// <returns>0 if successful, otherwise an error code.</returns>
 public int SetLayout(OptimusMiniLayout layout)
 {
     if (_Layout != layout)
     {
         _Layout = layout;
         for (byte i = 0; i <= 2; i++)
         {
             if (_LastImage[i] != null)
             {
                 Bitmap lBitmap = _LastImage[i].Clone(new Rectangle(0, 0, 96, 96), PixelFormat.Format24bppRgb);
                 RotateImage(lBitmap);
                 _Connection.SetImage(MapKeyIndex(i), lBitmap);
             }
         }
     }
     return(0);
 }
コード例 #2
0
 /// <summary>
 /// Sets orientation of device.
 /// </summary>
 /// <param name="orientation">Orientation to set.</param>
 /// <returns>0 if successful, otherwise an error code.</returns>
 public int SetOrientation(OptimusMiniOrientation orientation)
 {
     if (_Orientation != orientation)
     {
         _Orientation = orientation;
         for (byte i = 0; i <= 2; i++)
         {
             if (_LastImage[i] != null)
             {
                 Bitmap lBitmap = _LastImage[i].Clone(new Rectangle(0, 0, 96, 96), PixelFormat.Format24bppRgb);
                 RotateImage(lBitmap);
                 _Connection.SetImage(MapKeyIndex(i), lBitmap);
             }
         }
     }
     return(0);
 }