Most of the websites are php. Since no one has done it, I will share it...
Process .. flash takes a photo and submits it to the specified processing program.
Data: width, height, px + xxx
Parse rows and columns to fill in each dot matrix data.
// Save the width and height submitted by flash and verify the value
Int width = 0;
Int height = 0;
If (! Int. TryParse (Request. Form ["width"], out width )&&
! Int. TryParse (Request. Form ["height"], out height ))
{
Throw new ApplicationException ("the photo format is incorrect! ");
}
// Define bitmap, width, height, and format
Bitmap bmp = new Bitmap (width, height, System. Drawing. Imaging. PixelFormat. Format24bppRgb );
// The width * length * 3 is because each point requires three colors of rgb.
Int iBytes = width * height * 3;
Byte [] PixelValues = new byte [iBytes];
// Current location
Int iPoint = 0;
For (int I = 0; I {
String [] ss = Request. Form ["px" + I]. Split (','); // parse row Data Group
For (int j = 0; j <width; j ++)
{
String values = ss [j];
While (values. Length <6)
{
Values = "0" + values; // fill in the missing bits
}
String s1, s2, s3; // obtain RGB
S1 = values. Substring (0, 2 );
S2 = values. Substring (2, 2 );
S3 = values. Substring (4, 2 );
PixelValues [iPoint] = Convert. ToByte (Convert. ToInt32 (s1, 16 ));
PixelValues [iPoint + 1] = Convert. ToByte (Convert. ToInt32 (s2, 16 ));
PixelValues [iPoint + 2] = Convert. ToByte (Convert. ToInt32 (s3, 16 ));
// Set the dot Chen color
Bmp. SetPixel (j, I, Color. FromArgb (PixelValues [iPoint], PixelValues [iPoint + 1], PixelValues [iPoint + 2]);
IPoint + = 3;
}
}
// Note that the directory must have at least the User and User modification permissions.
String path = @ "d: \ test \" + DateTime. Now. ToFileTime () + ". jpg ";
Bmp. Save (path, ImageFormat. Jpeg );
// OK. This is the main process.
The compressed package contains the source code and the flash source code.
Http://www.bfor.cn/download/MakePic.rar