okay so i figured out a long time ago sorry i should have post this XD.
Charmz is just trying to make me look stupid but failing at it. you nub haha
btw i wasn't looking for speed so i don't really care that i used get pixel
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
Image ^img;
Bitmap ^bmp;
richTextBox1->Text = L"Analyzing Picture... \n";
img = pictureBox1->Image;
bmp = gcnew Bitmap(img);
int w = 0;
int h = 0;
w = bmp->Width;
h = bmp->Height;
// Store Each Pixel Into an Array of Data
for (int y=0; y<h; y++)
{
for (int x=0; x<w; x++){
c[x][y] = ColorTranslator::ToWin32(bmp->GetPixel(x, y));
};
}
// Edge Detection Algorithm
for (int y=1; y<h; y++){
for (int x=1; x<w; x++){
if (c[x][y] == 16777215) {
for (int i=0; i<8; i++) {
if (c[x + ax[i]][y + ay[i]] == 0) {
c[x][y] = 255;
}
}
}
}
};
richTextBox1->AppendText("Detected Edges" );
// Skyler's Pixel Algorithm
for (int y=0; y<h; y++) {
for (int x=0; x<w; x++){
bmp->SetPixel(x, y, ColorTranslator::FromWin32(c[x][y]));
};
}
// getbitma
// BitBlt(pictureBox1->Handle, 0, 0, w, h, handle, 0, 0, SRCCOPY);
//
pictureBox1->Image = bmp;
}