tags:

views:

41

answers:

1

hi please can you help me - i need to detect transparent pixels - thanks in advance. i use wpf and class image.

A: 

U don't need Image class, it is not design for pixel manipulation. Rater use Bitmap* class

BitmapImage bi = new BitmapImage();
bi.BeginInit();
bi.UriSource = new Uri(@"/test.png",UriKind.RelativeOrAbsolute);
bi.EndInit();

an exapmle

Implement public PixelColor[,] GetPixels(BitmapSource source) method and then interate through returned array to find Alpha channel ( a simple loop). Mind that some images does not support transparency and the file vary depends on structure (ARGB, RGBA) etc.

lukas
yes thanks. but some code there glitches. :)
in4man
heu can you help me more - Bitmap* What class should i use? *Image not supported?
in4man