dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: C# self-made bitmap reader

  1. #1
    Join Date
    Apr 2012
    Posts
    1

    C# self-made bitmap reader

    I am trying to make a bitmap reader without using the Bitmap class
    the bitmap i am using is in the attachment will you help me???
    Code:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    
    namespace WindowsFormsApplication1
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }
    
            private void Form1_Load(object sender, EventArgs e)
            {
    
    
            }
            private void Form1_Paint(object sender, PaintEventArgs e)
            {
                
               byte[] a = System.IO.File.ReadAllBytes("tst.bmp");
               
                int b =54;
                int c = 0;
                int d = 428;
             
                while (b != a.Length - 1)
                {
                    if (c != 594)
                    {
                        
                            e.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(a[b], a[b + 1], a[b + 2])), c, d, 1, 1);
                            c++;
                      
                    }
                    else
                    {
                        d--;
                        c = 0;
                    }
                    b+=3;
    
                }
            
             
            }
      
        }
    
    
    }
    Attached Files Attached Files

  2. #2
    Join Date
    May 2012
    Location
    Bonn, Germany
    Posts
    43

    Re: C# self-made bitmap reader

    If you want people to help you, you will need to provide a more detailed description of what doesn't work. You can't expect people do download and compile your code to see themselves.

    _________________________________
    Visit my project: Derivative Calculator

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)