Click here to Skip to main content
15,891,184 members
Home / Discussions / C#
   

C#

 
GeneralRe: Opacity Control Pin
Dustin Metzgar22-Jun-06 6:48
Dustin Metzgar22-Jun-06 6:48 
QuestionGraph to image Pin
Abel Castillo21-Jun-06 6:03
Abel Castillo21-Jun-06 6:03 
AnswerRe: Graph to image Pin
mikanu21-Jun-06 6:32
mikanu21-Jun-06 6:32 
GeneralRe: Graph to image Pin
Abel Castillo21-Jun-06 7:08
Abel Castillo21-Jun-06 7:08 
GeneralRe: Graph to image Pin
mikanu21-Jun-06 8:09
mikanu21-Jun-06 8:09 
GeneralRe: Graph to image [modified] Pin
Abel Castillo21-Jun-06 23:15
Abel Castillo21-Jun-06 23:15 
GeneralRe: Graph to image Pin
Abel Castillo22-Jun-06 0:57
Abel Castillo22-Jun-06 0:57 
GeneralRe: Graph to image [modified] Pin
mikanu22-Jun-06 6:37
mikanu22-Jun-06 6:37 
I don't know what is not working in your application but here is code that I wrote to verify your concept and it all works. To me, the problem is in your CreateBitmap() function.

To test the following code, create a new C# Windows Apllication. Drag and Drop two picture boxes on your form. Then paste this code as your Form Load event handler:

<code language="c#">

        private void Form1_Load(object sender, EventArgs e)
        {
            MemoryStream memStream = new MemoryStream();
            byte[] myBytes;

            using (Bitmap bmp = new Bitmap(50, 50))
            using (Graphics grfx = Graphics.FromImage(bmp))
            {
                grfx.FillRectangle(Brushes.Red, new Rectangle(0, 0, 50, 50));
                bmp.Save(memStream, System.Drawing.Imaging.ImageFormat.Bmp);
                myBytes = new byte[memStream.Length];
                memStream.Position = 0;
                memStream.Read(myBytes, 0, (int)memStream.Length);
                /* uncomment these lines to draw three white pixels on the second pictureBox */
                /*
                myBytes[101] = 255;
                myBytes[102] = 255;
                myBytes[103] = 255;
                myBytes[506] = 255;
                myBytes[507] = 255;
                myBytes[508] = 255;
                myBytes[910] = 255;
                myBytes[911] = 255;
                myBytes[912] = 255;
                */
                pictureBox1.Image = Image.FromStream(memStream);
                pictureBox2.Image = Image.FromStream(new MemoryStream(myBytes));
            }
        }
</code>

*** Portion of the code above is taken from the post below[^]

----
www.digitalGetto.com

-- modified at 12:38 Thursday 22nd June, 2006
GeneralRe: Graph to image Pin
Abel Castillo22-Jun-06 22:29
Abel Castillo22-Jun-06 22:29 
GeneralRe: Graph to image Pin
mikanu23-Jun-06 9:04
mikanu23-Jun-06 9:04 
GeneralRe: Graph to image Pin
Abel Castillo26-Jun-06 22:01
Abel Castillo26-Jun-06 22:01 
AnswerRe: Graph to image Pin
Josh Smith21-Jun-06 7:06
Josh Smith21-Jun-06 7:06 
Questionc# draw on vidoe Pin
eyale21-Jun-06 5:50
eyale21-Jun-06 5:50 
AnswerRe: c# draw on vidoe Pin
BlackDice21-Jun-06 6:24
BlackDice21-Jun-06 6:24 
GeneralRe: c# draw on vidoe Pin
led mike21-Jun-06 7:15
led mike21-Jun-06 7:15 
GeneralRe: c# draw on vidoe Pin
BlackDice21-Jun-06 7:38
BlackDice21-Jun-06 7:38 
GeneralRe: c# draw on vidoe Pin
led mike21-Jun-06 7:48
led mike21-Jun-06 7:48 
GeneralRe: c# draw on vidoe Pin
eyale22-Jun-06 8:08
eyale22-Jun-06 8:08 
GeneralRe: c# draw on vidoe Pin
led mike22-Jun-06 9:42
led mike22-Jun-06 9:42 
QuestionInstantiate Bitmap object from unmanaged memory/ Memory Allocation ? [modified] Pin
Florian Storck21-Jun-06 5:45
Florian Storck21-Jun-06 5:45 
Questioncheckinf for USB connection Pin
donkaiser21-Jun-06 4:20
donkaiser21-Jun-06 4:20 
QuestionError:- Could not access 'CDO.Message' object. Pin
nachisaravanan21-Jun-06 3:22
nachisaravanan21-Jun-06 3:22 
AnswerRe: Error:- Could not access 'CDO.Message' object. Pin
Not Active21-Jun-06 4:24
mentorNot Active21-Jun-06 4:24 
GeneralRe: Error:- Could not access 'CDO.Message' object. Pin
nachisaravanan21-Jun-06 4:34
nachisaravanan21-Jun-06 4:34 
GeneralRe: Error:- Could not access 'CDO.Message' object. Pin
Not Active21-Jun-06 4:38
mentorNot Active21-Jun-06 4:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.