bitmapsource Questions

2

Solved

In WPF, the System.Windows.Clipboard.getImage() function returns a BitmapSource object. As a newbie in WPF coming from a WinForms background, its not clear to me how to save this image to a file. W...
Escurial asked 24/5, 2010 at 21:24

6

Solved

What is the fastest (few lines of code and low resource usage) way to create an empty (0x0 px or 1x1 px and fully transparent) BitmapSource instance in c# that is used when nothing should be render...
Angstrom asked 26/8, 2010 at 9:40

2

Solved

My goal is to draw image "someImage.png", which is embedded resource, on WPF window, in overridden OnRender method: protected override void OnRender(System.Windows.Media.DrawingContext drawingCont...
Rivulet asked 22/3, 2015 at 18:25

1

I have a problem when saving and loading a PNG using BitmapSource and PngBitmapEncoder/Decoder. Basically, I'd like to be able to save an image that originated as an array of bytes, and when the PN...
Igenia asked 6/9, 2012 at 18:22

3

Solved

Ok, I tried this: TransformedBitmap tbm = new TransformedBitmap(myBitmapSource, new RotateTransform(angle)); return tbm; But this does not work with angles other than multiples of 90degrees. Ne...
Travancore asked 25/11, 2015 at 10:31

3

Solved

I'm trying to Convert a Bitmap (SystemIcons.Question) to a BitmapImage so I can use it in a WPF Image control. I have the following method to convert it to a BitmapSource, but it returns an Intero...
Bumper asked 13/3, 2010 at 22:21

2

Solved

How Do I convert BitmapSource to MemoryStream. Though I tried some code: private Stream StreamFromBitmapSource(BitmapSource writeBmp) { Stream bmp; using (bmp = new MemoryStream()) { BitmapEn...
Undergo asked 16/2, 2017 at 11:17

2

Solved

Quick question: I have this 1000 x 1000 bitmap image: and I use this routine to load it: private BitmapSource initialBitmap = new BitmapImage(new Uri("C:\\Users\\...\\Desktop\\Original.bmp"));...
Pursley asked 24/8, 2016 at 15:51

6

Solved

As far as I can tell the only way to convert from BitmapSource to Bitmap is through unsafe code... Like this (from Lesters WPF blog): myBitmapSource.CopyPixels(bits, stride, 0); unsafe { fixed (...
Hypoxia asked 17/2, 2010 at 20:59

2

Solved

I need to draw an image on the Image component at 30Hz. I use this code : public MainWindow() { InitializeComponent(); Messenger.Default.Register<Bitmap>(this, (bmp) => { ImageTarg...
Blues asked 9/6, 2015 at 8:55

3

I want to create a On/Off button in WPF and I want it to change its appearance when the user clicks it (if it was on switch to off, if it wad off switch to on) using images. I added the images I wa...
Entitle asked 1/1, 2013 at 11:34

1

Solved

i read the Wikipedia article on DPI, but it confused me even more... i don't have any DPI information on the image. What DPI should i use with BitmapSource.Create(), is it OK to use a constant one(...
Seychelles asked 22/3, 2013 at 20:31

1

Solved

I have a .NET BitmapSource object. I would like to read the four pixels in corners of the bitmap, and test whether all of them are darker than white. How can I do that? Edit: I wouldn't mind conve...
Mayramays asked 14/2, 2013 at 14:26

1

Solved

I have a BitmapSource 1690x214 (taken from an EMF file using this code), and I want to use this image as ToolTip. This is the image displayed using Paint: So i wrote this code: BitmapSource bmp...
Corinnecorinth asked 19/6, 2012 at 17:58

2

Solved

I am a beginner with WPF and trying a home project to become familiar with the technology. I have a simple form where the user selects an image file, I then display EXIF data along with a thumbnail...
Marguritemargy asked 24/1, 2010 at 19:34

4

Solved

I am trying to figure out how can I copy DispatcherObject (in my case BitmapSource) into another thread. Use case: I have a WPF app that needs to show window in a new thread (the app is actually O...
Crucial asked 3/5, 2010 at 15:18

1

Solved

I'm developing a BlackJack program which shows a BlackJack Table, cards, etc. The plan is that it'll be playing thousands of hands one after another with an automated strategy. I have a PlayerSeat...
Berk asked 28/8, 2011 at 2:47

2

Solved

I need to parse the content of Clipboard.GetImage() (a BitmapSource) to a BitmapImage. Does anyone knows how can this be done?
Russianize asked 17/3, 2011 at 11:16

1

Solved

I have a DrawingBrush with some vector graphics. I want to convert it to BitmapSource as an intermediate step to getting it to Bitmap. What's the (best) way to do this?
Tellurite asked 12/8, 2011 at 9:23

1

Solved

The point is, that I need to convert to a System.Drawing.Bitmap (.Net Framework 2.0) to get a single frame of an WPF Grid with its content. I read about VisualBrush and DrawingBrush but I cannot ...
Handbag asked 13/7, 2011 at 8:24

1

Solved

I am using the following to convert a BitmapSource to a Bitmap: internal static Bitmap ConvertBitmapSourceToBitmap(BitmapSource bitmapSrc) { int width = bitmapSrc.PixelWidth; int height = bitmap...
Hemispheroid asked 16/6, 2011 at 14:41

1

Solved

I am trying to copy a part of a BitmapSource to a WritableBitmap. This is my code so far: var bmp = image.Source as BitmapSource; var row = new WriteableBitmap(bmp.PixelWidth, bottom - top, bmp.D...
Brandonbrandt asked 3/5, 2011 at 9:37

1

Solved

I'm trying to get an bitmap created from raw data to show in WPF, by using an Image and a BitmapSource: Int32[] data = new Int32[RenderHeight * RenderWidth]; for (Int32 i = 0; i < RenderHeight...
Valor asked 31/12, 2009 at 3:19

3

Solved

I have a memory leak issue in my application which loads a large amount of images. I'm rather new to C#, and thought my days of memory leak issues were past. I can't figure out the problem - maybe ...
Chura asked 11/11, 2009 at 12:18

1

Solved

System: Windows XP SP3, .NET 3.5, 4GB RAM, Dual 1.6gHz I have a WPF application that loads and transitions (using Storyboard animations) extremely large PNGs. These PNGs are 8190x1080 in resolutio...
Herrod asked 5/11, 2009 at 23:52

© 2022 - 2024 — McMap. All rights reserved.