![]() ![]() Label1->Text = String::Format( "Pixel format: ", image1->PixelFormat ) ![]() Set the PictureBox to display the image. Loop through the images pixels to reset color.Ĭolor pixelColor = image1->GetPixel( x, y ) Ĭolor newColor = Color::FromArgb( pixelColor.R, 0, 0 ) Image1 = gcnew Bitmap( "C:\\Documents and Settings\\All Users\\" Void Button1_Click( System::Object^ /*sender*/, System::EventArgs^ /*e*/ ) Paste the code into the form and associate the Button1_Click method with the button's Click event. This example is designed to be used with a Windows Forms that contains a Label, PictureBox, and Button named Label1, PictureBox1, and Button1, respectively. It also uses the PixelFormat, Width, and Height properties. The following code example demonstrates how to construct a new Bitmap from a file, using the GetPixel and SetPixel methods to recolor the image. ComVisibleAttribute SerializableAttribute Examples
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |