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


C# Bitmap.GetBitmap方法代码示例

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


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

示例1: camera_BitmapStreamed

        void camera_BitmapStreamed(Camera sender, Bitmap bitmap)
        {
            if (!picTimeout.IsRunning && GT.Timer.GetMachineTime() >= webcamStreamStopTime)
            {
                //Debug.Print("Stopping bitmap streaming");
                camera.StopStreamingBitmaps();
            }

            if (responders.Count > 0)
            {
                byte[] bmpFile = new byte[bitmap.Width * bitmap.Height * 3 + 54];
                GHI.Premium.System.Util.BitmapToBMPFile(bitmap.GetBitmap(), bitmap.Width, bitmap.Height, bmpFile);
                GT.Picture picture = new GT.Picture(bmpFile, GT.Picture.PictureEncoding.BMP);

                numresponses++;
                Debug.Print("Sending webcam response " + numresponses  + " to " + responders.Count + " clients");
                foreach (HomeOSGadgeteer.Networking.Responder responder in responders)
                {
                    try
                    {
                        responder.Respond(picture);
                    }
                    catch { }
                }
                responders.Clear();
            }

            if (picTimeout.IsRunning) 
            {
                oledDisplay.SimpleGraphics.DisplayImage(lastBitmap, 0, 0);
                oledDisplay.SimpleGraphics.Redraw();
                Debug.Print("Picture streamed -> screen");
            } 
        }
开发者ID:donnaknew,项目名称:programmingProject,代码行数:34,代码来源:Program.cs

示例2: SetBootLogo

        public static bool SetBootLogo(Bitmap logo, int x, int y)
        {
            if (Utils.IsEmulator)
                return false;

            if (logo != null)
            {
                // New settings were saved, must reboot
                // The start-up logo will take effect after the first reset
                bool res = Configuration.StartUpLogo.Set(logo.GetBitmap(), x, y);
                Thread.Sleep(1000); // to set logo bitmap
                Configuration.StartUpLogo.Enabled = true;

                return res;
                //return Configuration.StartUpLogo.Set(logo.GetBitmap(), (int)(ScreenWidth - logo.Width) / 2, (int)(ScreenHeight - logo.Height) / 2);
            }
            else
            {
                if (Configuration.StartUpLogo.Enabled)
                {
                    Configuration.StartUpLogo.Enabled = false;
                    return true;
                }
                else
                    return false;
            }
        }
开发者ID:KonstantinKolesnik,项目名称:MFE,代码行数:27,代码来源:LCDManager.cs

示例3: TinyBitmap

		/// <summary>
		/// Constructs a TinyBitmap from a preexisting bitmap.
		/// </summary>
		/// <param name="bitmap">The bitmap to construct from.</param>
		public TinyBitmap(Bitmap bitmap)
		{
			this.Width = (uint)bitmap.Width;
			this.Height = (uint)bitmap.Height;
			this.Data = new byte[this.Width * this.Height * 2];
			Util.BitmapConvertBPP(bitmap.GetBitmap(), this.Data, Util.BPP_Type.BPP16_BGR_BE);
		}
开发者ID:errolt,项目名称:NETMF4.3_Community,代码行数:11,代码来源:TinyBitmap.cs

示例4: Image

 public Image(Bitmap imageBMP)
 {
     image_data = new byte[imageBMP.Width * imageBMP.Height * 2];
     GHI.OSHW.Hardware.Util.BitmapConvertBPP(imageBMP.GetBitmap(), image_data, GHI.OSHW.Hardware.Util.BPP_Type.BPP16_RGB_BE);
     image_width = (ushort)imageBMP.Width;
     image_height = (ushort)imageBMP.Height;
     
 }
开发者ID:richoxski,项目名称:netmf-community-ports,代码行数:8,代码来源:Image.cs

示例5: seePicture_WebEventReceived

        void seePicture_WebEventReceived(string path, WebServer.HttpMethod method, Responder responder)
        {
            if (pic != null)
            {
                Bitmap b = new Bitmap(320, 240);
                b.DrawLine(Colors.Red, 20, 0, 0, 319, 239);
                byte[] buff = new byte[320 * 240 * 3 + 54];
                GHIElectronics.NETMF.System.Util.BitmapToBMPFile(b.GetBitmap(), 320, 240, buff);

                GT.Picture picture = new GT.Picture(buff, GT.Picture.PictureEncoding.BMP);

                responder.Respond(picture);
            }
            else
                responder.Respond("Take picture first");
        }
开发者ID:simonmonk,项目名称:gadgeteer_book,代码行数:16,代码来源:Program.cs

示例6: Draw

        /// <summary>
        /// Draws an image to the screen.
        /// </summary>
        /// <param name="bmp">The bitmap to be drawn to the screen</param>
        /// <param name="x">Starting X position of the image.</param>
        /// <param name="y">Starting Y position of the image.</param>
        public void Draw(Bitmap bmp, uint x = 0, uint y = 0)
        {
            if (Module.Mainboard.NativeBitmapConverter == null)
                Module.Mainboard.NativeBitmapConverter = new Mainboard.BitmapConvertBPP(BitmapConverter);

            byte[] rawData = new byte[bmp.Width * bmp.Height * 2];
            Module.Mainboard.NativeBitmapConverter(bmp.GetBitmap(), rawData, Mainboard.BPP.BPP16_BGR_BE);
            DrawRaw(rawData, (uint)bmp.Width, (uint)bmp.Height, x, y);
        }
开发者ID:KonstantinKolesnik,项目名称:MFE,代码行数:15,代码来源:Display.cs


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