当前位置: 首页>>代码示例>>C#>>正文


C# ImageButton.BringToFront方法代码示例

本文整理汇总了C#中ImageButton.BringToFront方法的典型用法代码示例。如果您正苦于以下问题:C# ImageButton.BringToFront方法的具体用法?C# ImageButton.BringToFront怎么用?C# ImageButton.BringToFront使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ImageButton的用法示例。


在下文中一共展示了ImageButton.BringToFront方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TabButton

        public TabButton()
        {
            InitializeComponent();

            this.Height = imageClicked.Height;
            this.Width = imageClicked.Width;

            button = new ImageButton(imageHover, imageClicked, imageUnclicked, "");
            button.Location = new Point(0, 0);
            this.Controls.Add(button);
            buttonX = new ImageButton(imageXHover, imageXClicked, imageXUnclicked, imageXUnclicked, "");
            buttonX.Location = new Point(this.Width - imageXClicked.Width - 5, 5);
            this.Controls.Add(buttonX);
            buttonX.BringToFront();

            button.MouseDown += Button_MouseDown;
            buttonX.Click += ButtonX_Click;
        }
开发者ID:CodeSuffer,项目名称:TnT,代码行数:18,代码来源:TabButton.cs

示例2: OnCreate

      protected override void OnCreate(Bundle bundle)
      {
         base.OnCreate(bundle);
         RequestWindowFeature(WindowFeatures.NoTitle);
         bool cameraPreviewCallbackWithBuffer = false;
         SetContentView(Resource.Layout.CameraPreviewLayout);

         _bgrBuffers = new ImageBufferFactory<Mat>(size => new Mat(size.Height, size.Width, DepthType.Cv8U, 3));
         _previewBitmapBuffers = new ImageBufferFactory<Android.Graphics.Bitmap>(s => Android.Graphics.Bitmap.CreateBitmap(s.Width, s.Height, Android.Graphics.Bitmap.Config.Rgb565));

         _topLayer = new ProcessedCameraPreview(this, cameraPreviewCallbackWithBuffer);
         _topLayer.PictureTaken += this.PictureTaken;
         _topLayer.ImagePreview += this.ImagePreview;
         
         _preview = new CameraPreview(this, _topLayer, cameraPreviewCallbackWithBuffer);

         RelativeLayout mainLayout = FindViewById<RelativeLayout>(Resource.Id.CameraPreiewRelativeLayout);
         
         mainLayout.AddView(_preview, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.FillParent));
         mainLayout.AddView(_topLayer, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.FillParent));

#if GL_VIEW
         _topLayer.SetZOrderOnTop(true);
#endif
         RequestedOrientation = Android.Content.PM.ScreenOrientation.Landscape;

         ImageButton switchCameraButton = FindViewById<ImageButton>(Resource.Id.CameraPreviewSwitchCameraImageButton);
         if (Camera.NumberOfCameras <= 1)
            switchCameraButton.Visibility = ViewStates.Invisible;
         else
         {
            switchCameraButton.BringToFront();
         }
         switchCameraButton.Click += delegate
         {
            _preview.SwitchCamera();
         };

         ImageButton captureImageButton = FindViewById<ImageButton>(Resource.Id.CameraPreviewCaptureImageButton);
         captureImageButton.Click += delegate
         {
            Camera camera = _preview.Camera;

            if (camera != null)
            {
               Camera.Parameters p = camera.GetParameters();
               p.PictureFormat = Android.Graphics.ImageFormatType.Jpeg;
               //p.PictureFormat = Android.Graphics.ImageFormatType.Rgb565;
               camera.SetParameters(p);
               camera.TakePicture(null, null, _topLayer);
            }
         };

         _lastCapturedImageButton = FindViewById<ImageButton>(Resource.Id.capturedImageButton);
         _lastCapturedImageButton.Click += delegate
         {
            if (_lastSavedImageFile != null)
            {
               Intent intent = new Intent(Intent.ActionView, Android.Net.Uri.FromFile(new Java.IO.File(_lastSavedImageFile.FullName)));
               intent.SetType("image/jpeg");
               StartActivity(intent);
            }
         };
         _lastCapturedImageButton.BringToFront();

         _previewButtons = new ImageButton[4];
         _previewFilters = new ImageFilter[4];
         _previewButtons[0] = FindViewById<ImageButton>(Resource.Id.previewImageButton);
         _previewFilters[0] = null;
         _previewButtons[0].Click += delegate
         {
            if (_imageFilter != null)
            {
               _imageFilter.Dispose();
               _imageFilter = null;
            }
         };
         _previewButtons[1] = FindViewById<ImageButton>(Resource.Id.cannyImageButton);
         _previewFilters[1] = new CannyFilter(100, 60, 3);

         _previewButtons[2] = FindViewById<ImageButton>(Resource.Id.colorMapImageButton);
         _previewFilters[2] = new ColorMapFilter(Emgu.CV.CvEnum.ColorMapType.Autumn);
         
         //_previewFilters[3] = new ColorMapFilter(Emgu.CV.CvEnum.ColorMapType.Summer);
         //_previewFilters[3] = null;
         _previewButtons[3] = FindViewById<ImageButton>(Resource.Id.distorImageButton);
         _previewFilters[3] =  new DistorFilter(0.5, 0.5, -1.5);

         for (int i = 1; i < _previewButtons.Length; ++i)
         {
            ImageFilter f = _previewFilters[i];
            _previewButtons[i].Click += delegate
            {
               if (_imageFilter != null)
                  _imageFilter.Dispose();
               _imageFilter = f.Clone() as ImageFilter;
            };
         }
      }
开发者ID:reidblomquist,项目名称:emgucv,代码行数:99,代码来源:CameraPreviewActivity.cs


注:本文中的ImageButton.BringToFront方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。