本文整理汇总了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");
}
}
示例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;
}
}
示例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);
}
示例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;
}
示例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");
}
示例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);
}