TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
zozo ahmed
NA
18
16k
copy data from bitmap array into new array store data of bmp
Dec 30 2013 6:19 PM
I work on bitmap i read header of bmp 24 bit per pixel ,width 320 height 240,offset start of image data in location 54,use c#
in location 54 in bmp array i access to data ,i store data in new array :
struct pix //structure for pixel in bmp image
{
public byte r;//Red
public byte g;//Green
public byte b;//Blue
};
Bitmap img = new Bitmap(opendialog1.FileName);
string filename = opendialog1.FileName;
byte[] bmp = File.ReadAllBytes(filename);
int i=54;
pix[ , ] bmpdata = new pix[img.Height, img.Width]; //create array of structure
for (int row = 0; row < img.Height; row++)
{
for (int col = 0; col < img.Width; col++)
{
bmpdata[row, col].r = bmp[i];
bmpdata[row, col].g = bmp[i + 1];
bmpdata[row, col].b = bmp[i + 2];
i += 3;
}
is this correct method for copy data from bmp array into new array for data only ,i use c# window form ?
Reply
Answers (
1
)
How to run exe as administrator in Windows 7 in Vs.Net
I don't want to loose my data