Skip to content

Instantly share code, notes, and snippets.

@yuvarajoo
yuvarajoo / .gitignore
Created April 14, 2019 03:30 — forked from michalczukm/.gitignore
WPF projects .gitignore
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.sln.docstates
# Build results
[Dd]ebug/
@yuvarajoo
yuvarajoo / install_bc2835.sh
Created December 23, 2018 04:36
Install Raspberry pI BCM2835
cd ~
wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.58.tar.gz
tar xvfz bcm2835-1.58.tar.gz;
cd bcm2835-1.58;
./configure;
make;
sudo make install
@yuvarajoo
yuvarajoo / bitmap.cs
Created April 2, 2018 04:03
Convert Bitmap to BitmapSource
public static BitmapSource ConvertBitmap(Bitmap source)
{
return System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(
source.GetHbitmap(),
IntPtr.Zero,
Int32Rect.Empty,
BitmapSizeOptions.FromEmptyOptions());
}
@yuvarajoo
yuvarajoo / bitmap.cs
Last active April 2, 2018 04:01
Convert BitmapSource to Bitmap
private Bitmap GetBitmap(BitmapSource source)
{
Bitmap bmp = new Bitmap
(
source.PixelWidth,
source.PixelHeight,
System.Drawing.Imaging.PixelFormat.Format32bppPArgb
);
BitmapData data = bmp.LockBits