0

hi
i finished writing c# algorithm that is applied on a '24 bit depth' bitmap image that i called from file, and it was success; but when i apply the algorithm on a 32 bit depth image a break while running occur which is : " Value does not fall within the expected range".

what i have to do in order to apply my code on this type of image "32bit".
i think i have to do something after the 'image.fromfile', to make it acceptable by the rest of the code.
plz reply me your suggestion!

1
Contributor
2
Replies
3
Views
11 Years
Discussion Span
Last Post by manar
0

note:
when i add the bold statement, the result shown is a black image!, what i have to do??

private void button2_Click(object sender, System.EventArgs e)
    {

        Image b = Image.FromFile(@"C:\project\test1.bmp" );

        Bitmap source =(Bitmap)b;
        [B]source = new Bitmap(320, 240, System.Drawing.Imaging.PixelFormat.Format24bppRgb);[/B]                        Gray(source);
        SobelEdgeDetector s= new SobelEdgeDetector();
        Bitmap k = s.Apply(source);
        g.DrawImage(k,5 ,5 );
        k.Save(@"C:\project\rr.bmp");
    }

Edited by pyTony: fixed formatting

0

re hi
any suggestion to convert the bitmap from 32 bit depth pixel to 24 bit (removing alpha)??
reply if you have an idea :o

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.