網頁

2017年11月29日 星期三

ex9 使用.NET Bitmap class

34 則留言:

  1. #include<iostream>
    #include<cstdlib>
    using namespace std;
    #using<System.Drawing.dll>
    using namespace System::Drawing;
    //Bitmap 類別
    //https://msdn.microsoft.com/zh-tw/library/system.drawing.bitmap(v=vs.110).aspx
    int main() {
    cout << "我們要測試圖檔:lena\n";
    Bitmap im("lena.jpg");
    int W = im.Width;
    int H = im.Height;
    cout << "H=" << H << "\nW=" << W<<endl;
    Bitmap im2(W,H );
    for (int x = 0; x < W; x++) {
    for (int y = 0; y < H; y++) {
    Color pp = im.GetPixel(x, y);
    int R = pp.R;
    int G = pp.G;
    int B = pp.B;
    Color pp2 = Color::FromArgb(0, G, B);
    im2.SetPixel(x, y, pp2);
    }
    }
    im2.Save("lena_C.png");
    system("Pause");
    return 0;
    }

    回覆刪除
  2. B10433081 巫明芬2017年11月29日 下午3:09

    #include<iostream>
    #include<cstdlib>

    using namespace std;

    #using <System.Drawing.dll>
    using namespace System::Drawing;
    int main()
    {
    cout << "我們要測試圖檔\"Lena\"!\n";
    Bitmap im("lena.jpg");
    int W = im.Width;
    int H = im.Height;
    cout << W << " " << H << endl;
    Bitmap im2(W, H);
    for(int x=0;x<W;x++)
    for (int y = 0; y < H; y++) {
    Color pp = im.GetPixel(x, y);
    int R = pp.R;
    int G = pp.G;
    int B = pp.B;
    Color p2 = Color::FromArgb(0, G, B);
    im2.SetPixel(x, y, p2);
    }
    im2.Save("lena_Z.png");
    system("Pause");
    return 0;
    }

    回覆刪除
  3. B10533007 魏辰熾2017年11月29日 下午3:09

    #include <iostream>
    #include <cstdlib>
    using namespace std;
    #using <System.Drawing.dll>
    using namespace System::Drawing;
    int main()
    {
    cout << "喔喔喔!!!\"ooo\"!\n";
    Bitmap im("000.jpg");
    int W = im.Width;
    int H = im.Height;
    cout << W << "/"<< H << endl;
    Bitmap im2(W,H);
    for (int x = 0; x < W; x++)
    for (int y = 0; y < H; y++) {
    Color pp = im.GetPixel(x, y);
    int R = pp.R;
    int G = pp.G;
    int B = pp.B;
    Color p2 = Color::FromArgb(0,0,B);
    im2.SetPixel(x, y, p2);
    }
    im2.Save("000_B.JPG");
    system("Pause");
    return 0;
    }

    回覆刪除
  4. B10533011 江道逸2017年11月29日 下午3:11

    #include <iostream>
    #include <cstdlib>
    using namespace std;
    #using <System.Drawing.dll>
    using namespace System::Drawing;
    int main()
    {
    cout << "喔喔喔!!!\"ooo\"!\n";
    Bitmap im("000.jpg");
    int W = im.Width;
    int H = im.Height;
    cout << W << "/"<< H << endl;
    Bitmap im2(W,H);
    for (int x = 0; x < W; x++)
    for (int y = 0; y < H; y++) {
    Color pp = im.GetPixel(x, y);
    int R = pp.R;
    int G = pp.G;
    int B = pp.B;
    Color p2 = Color::FromArgb(R,0,B);
    im2.SetPixel(x, y, p2);
    }
    im2.Save("000_0.JPG");
    system("Pause");
    return 0;
    }

    回覆刪除
  5. B10433072 廖翊翔2017年11月29日 下午3:11

    #include<iostream>
    #include<cstdlib>

    using namespace std;

    #using <System.Drawing.dll>
    using namespace System::Drawing;
    int main()
    {
    cout << "我們要測試圖檔\"Lena\"!\n";
    Bitmap im("lena.jpg");
    int W = im.Width;
    int H = im.Height;
    cout << W << " " << H << endl;
    Bitmap im2(W, H);
    for(int x=0;x<W;x++)
    for (int y = 0; y < H; y++) {
    Color pp = im.GetPixel(x, y);
    int R = pp.R;
    int G = pp.G;
    int B = pp.B;
    Color p2 = Color::FromArgb(0, G, B);
    im2.SetPixel(x, y, p2);
    }
    im2.Save("lena_Z.png");
    system("Pause");
    return 0;
    }

    回覆刪除
  6. B10433094 簡筱芸2017年11月29日 下午3:12

    #include<iostream>
    #include<cstdlib>

    using namespace std;

    #using <System.Drawing.dll>
    using namespace System::Drawing;
    int main()
    {
    cout << "我們要測試圖檔\"Lena\"!\n";
    Bitmap im("lena.jpg");
    int W = im.Width;
    int H = im.Height;
    cout << W << " " << H << endl;
    Bitmap im2(W, H);
    for(int x=0;x<W;x++)
    for (int y = 0; y < H; y++) {
    Color pp = im.GetPixel(x, y);
    int R = pp.R;
    int G = pp.G;
    int B = pp.B;
    Color p2 = Color::FromArgb(0, G, B);
    im2.SetPixel(x, y, p2);
    }
    im2.Save("lena_Z.png");
    system("Pause");
    return 0;
    }

    回覆刪除
  7. B10533008 張士晟2017年11月29日 下午3:12

    #include
    #include
    using namespace std;
    #using
    using namespace System::Drawing;
    int main()
    {
    cout << "喔喔喔!!!\"ooo\"!\n";
    Bitmap im("000.jpg");
    int W = im.Width;
    int H = im.Height;
    cout << W << "/"<< H << endl;
    Bitmap im2(W,H);
    for (int x = 0; x < W; x++)
    for (int y = 0; y < H; y++) {
    Color pp = im.GetPixel(x, y);
    int R = pp.R;
    int G = pp.G;
    int B = pp.B;
    Color p2 = Color::FromArgb(R,0,0);
    im2.SetPixel(x, y, p2);
    }
    im2.Save("000_R.JPG");
    system("Pause");
    return 0;
    }

    回覆刪除
  8. B10433090 蔡語鋐2017年11月29日 下午3:13

    #include<iostream>
    #include<cstdlib>

    using namespace std;

    #using <System.Drawing.dll>
    using namespace System::Drawing;
    int main()
    {
    cout << "我們要測試圖檔\"Lena\"!\n";
    Bitmap im("lena.jpg");
    int W = im.Width;
    int H = im.Height;
    cout << W << " " << H << endl;
    Bitmap im2(W, H);
    for(int x=0;x<W;x++)
    for (int y = 0; y < H; y++) {
    Color pp = im.GetPixel(x, y);
    int R = pp.R;
    int G = pp.G;
    int B = pp.B;
    Color p2 = Color::FromArgb(0, G, B);
    im2.SetPixel(x, y, p2);
    }
    im2.Save("lena_Z.png");
    system("Pause");
    return 0;
    }

    回覆刪除
  9. B10433073 何明宗2017年11月29日 下午3:13

    #include<iostream>
    #include<cstdlib>

    using namespace std;

    #using <System.Drawing.dll>
    using namespace System::Drawing;
    int main()
    {
    cout << "我們要測試圖檔\"Lena\"!\n";
    Bitmap im("lena.jpg");
    int W = im.Width;
    int H = im.Height;
    cout << W << " " << H << endl;
    Bitmap im2(W, H);
    for(int x=0;x<W;x++)
    for (int y = 0; y < H; y++) {
    Color pp = im.GetPixel(x, y);
    int R = pp.R;
    int G = pp.G;
    int B = pp.B;
    Color p2 = Color::FromArgb(0, G, B);
    im2.SetPixel(x, y, p2);
    }
    im2.Save("lena_Z.png");
    system("Pause");
    return 0;
    }

    回覆刪除
  10. B10533008 張士晟2017年11月29日 下午3:13

    #include <iostream>
    #include <cstdlib>
    using namespace std;
    #using <System.Drawing.dll>
    using namespace System::Drawing;
    int main()
    {
    cout << "喔喔喔!!!\"ooo\"!\n";
    Bitmap im("000.jpg");
    int W = im.Width;
    int H = im.Height;
    cout << W << "/"<< H << endl;
    Bitmap im2(W,H);
    for (int x = 0; x < W; x++)
    for (int y = 0; y < H; y++) {
    Color pp = im.GetPixel(x, y);
    int R = pp.R;
    int G = pp.G;
    int B = pp.B;
    Color p2 = Color::FromArgb(R,0,0);
    im2.SetPixel(x, y, p2);
    }
    im2.Save("000_R.JPG");
    system("Pause");
    return 0;
    }

    回覆刪除
  11. B10533009 張仲崴2017年11月29日 下午3:13

    #include <iostream>
    #include <cstdlib>
    using namespace std;
    #using <System.Drawing.dll>
    using namespace System::Drawing;
    int main()
    {
    cout << "喔喔喔!!!\"ooo\"!\n";
    Bitmap im("000.jpg");
    int W = im.Width;
    int H = im.Height;
    cout << W << "/"<< H << endl;
    Bitmap im2(W,H);
    for (int x = 0; x < W; x++)
    for (int y = 0; y < H; y++) {
    Color pp = im.GetPixel(x, y);
    int R = pp.R;
    int G = pp.G;
    int B = pp.B;
    Color p2 = Color::FromArgb(R,0,0);
    im2.SetPixel(x, y, p2);
    }
    im2.Save("000_R.JPG");
    system("Pause");
    return 0;
    }

    回覆刪除
  12. B10433106 簡瑋佑2017年11月29日 下午3:14

    #include<iostream>
    #include<cstdlib>

    using namespace std;

    #using <System.Drawing.dll>
    using namespace System::Drawing;
    int main()
    {
    cout << "我們要測試圖檔\"Lena\"!\n";
    Bitmap im("lena.jpg");
    int W = im.Width;
    int H = im.Height;
    cout << W << " " << H << endl;
    Bitmap im2(W, H);
    for(int x=0;x<W;x++)
    for (int y = 0; y < H; y++) {
    Color pp = im.GetPixel(x, y);
    int R = pp.R;
    int G = pp.G;
    int B = pp.B;
    Color p2 = Color::FromArgb(0, G, B);
    im2.SetPixel(x, y, p2);
    }
    im2.Save("lena_Z.png");
    system("Pause");
    return 0;
    }

    回覆刪除
  13. B10533018 陳郁傑2017年11月29日 下午3:14

    #include <iostream>
    #include <cstdlib>
    using namespace std;
    #using <System.Drawing.dll>
    using namespace System::Drawing;
    int main()
    {
    cout << "喔喔喔!!!\"ooo\"!\n";
    Bitmap im("000.jpg");
    int W = im.Width;
    int H = im.Height;
    cout << W << "/"<< H << endl;
    Bitmap im2(W,H);
    for (int x = 0; x < W; x++)
    for (int y = 0; y < H; y++) {
    Color pp = im.GetPixel(x, y);
    int R = pp.R;
    int G = pp.G;
    int B = pp.B;
    Color p2 = Color::FromArgb(R,0,0);
    im2.SetPixel(x, y, p2);
    }
    im2.Save("000_R.JPG");
    system("Pause");
    return 0;
    }

    回覆刪除
  14. #include <iostream>
    #include <cstdlib>
    using namespace std;

    #using <System.Drawing.dll>
    using namespace System::Drawing;
    int main()
    {
    cout << "我們要測試圖檔\"Lena\"!\n";
    Bitmap im("lena.jpg");
    int W = im.Width;
    int H = im.Height;
    cout << W << " " << H << endl;
    Bitmap im2(W, H);
    for (int x=0; x<W; x++)
    for (int y = 0; y < H; y++) {
    Color pp = im.GetPixel(x, y);
    int R = pp.R;
    int G = pp.G;
    int B = pp.B;
    Color p2 = Color::FromArgb(0, G, 0);
    im2.SetPixel(x, y, p2);
    }
    im2.Save("lean_R.png");
    system("Pause");
    return 0;
    }

    回覆刪除
  15. #include <iostream>
    #include <cstdlib>
    using namespace std;
    #using <System.Drawing.dll>
    using namespace System::Drawing;
    int main()
    {
    cout << "喔喔喔!!!\"ooo\"!\n";
    Bitmap im("000.jpg");
    int W = im.Width;
    int H = im.Height;
    cout << W << "/"<< H << endl;
    Bitmap im2(W,H);
    for (int x = 0; x < W; x++)
    for (int y = 0; y < H; y++) {
    Color pp = im.GetPixel(x, y);
    int R = pp.R;
    int G = pp.G;
    int B = pp.B;
    Color p2 = Color::FromArgb(R,0,B);
    im2.SetPixel(x, y, p2);
    }
    im2.Save("000_0.JPG");
    system("Pause");
    return 0;
    }

    回覆刪除
  16. B10533006 劉純賓2017年11月29日 下午3:16

    #include <iostream>
    #include <cstdlib>
    using namespace std;
    #using <System.Drawing.dll>
    using namespace System::Drawing;
    int main()
    {
    cout << "喔喔喔!!!\"ooo\"!\n";
    Bitmap im("000.jpg");
    int W = im.Width;
    int H = im.Height;
    cout << W << "/"<< H << endl;
    Bitmap im2(W,H);
    for (int x = 0; x < W; x++)
    for (int y = 0; y < H; y++) {
    Color pp = im.GetPixel(x, y);
    int R = pp.R;
    int G = pp.G;
    int B = pp.B;
    Color p2 = Color::FromArgb(R,0,B);
    im2.SetPixel(x, y, p2);
    }
    im2.Save("000_0.JPG");
    system("Pause");
    return 0;
    }

    回覆刪除
  17. B10533011 江道逸2017年11月29日 下午3:16

    #include <iostream>
    #include <cstdlib>
    using namespace std;
    #using <System.Drawing.dll>
    using namespace System::Drawing;
    int main()
    {
    cout << "喔喔喔!!!\"ooo\"!\n";
    Bitmap im("000.jpg");
    int W = im.Width;
    int H = im.Height;
    cout << W << "/"<< H << endl;
    Bitmap im2(W,H);
    for (int x = 0; x < W; x++)
    for (int y = 0; y < H; y++) {
    Color pp = im.GetPixel(x, y);
    int R = pp.R;
    int G = pp.G;
    int B = pp.B;
    Color p2 = Color::FromArgb(0,0,B);
    im2.SetPixel(x, y, p2);
    }
    im2.Save("000_0.JPG");
    system("Pause");
    return 0;
    }

    回覆刪除
  18. #include <iostream>
    #include <cstdlib>
    #include <fstream>
    using namespace std;
    #using<System.Drawing.dll>
    using namespace System;; Drawing;

    int main()
    {
    cout << "我們要測試圖檔\"Lena\"!\n";
    Bitmap im("C:\\Users\\a426\\Desktop\\vc\\bitmap\\lena.jpg");
    int W = im.Width;
    int H = im.Height;
    cout << W << " " << H << endl;
    Bitmap im2(W, H);
    for(int x=0;x<W;x++)
    for (int y = 0; y < H; y++) {
    Color pp = im.GetPixel(x, y);
    int R = pp.R;
    int G = pp.G;
    int B = pp.B;
    Color p2 = Color::FromArgb(0, G, 0);
    im2.SetPixel(x, y, p2);
    }
    im2.Save("lena_G.jpg");
    system("Pause");
    return 0;
    }

    回覆刪除
  19. #include <iostream>
    #include <cstdlib>
    #include <fstream>
    using namespace std;
    #using<System.Drawing.dll>
    using namespace System;; Drawing;

    int main()
    {
    cout << "我們要測試圖檔\"Lena\"!\n";
    Bitmap im("C:\\Users\\a426\\Desktop\\vc\\bitmap\\lena.jpg");
    int W = im.Width;
    int H = im.Height;
    cout << W << " " << H << endl;
    Bitmap im2(W, H);
    for(int x=0;x<W;x++)
    for (int y = 0; y < H; y++) {
    Color pp = im.GetPixel(x, y);
    int R = pp.R;
    int G = pp.G;
    int B = pp.B;
    Color p2 = Color::FromArgb(0, G, 0);
    im2.SetPixel(x, y, p2);
    }
    im2.Save("lena_G.jpg");
    system("Pause");
    return 0;
    }

    回覆刪除
  20. #include
    #include
    using namespace std;

    #using
    using namespace System::Drawing;
    int main()
    {
    cout << "我們要測試圖檔\"Lena\"!\n";
    Bitmap im("C:\\Users\\a426\\Desktop\\B10533010\\lena.jpg");
    int W = im.Width;
    int H = im.Height;
    cout << W << " " << H << endl;
    Bitmap im2(W, H);
    for (int x = 0; x<W; x++)
    for (int y = 0; y < H; y++) {
    Color pp = im.GetPixel(x, y);
    int R = pp.R;
    int G = pp.G;
    int B = pp.B;
    Color p2 = Color::FromArgb(0, G, 0);
    im2.SetPixel(x, y, p2);
    }
    im2.Save("lena_R.png");
    system("Pause");
    return 0;
    }

    回覆刪除
  21. B10433099 駱婉婷2017年11月29日 下午3:39

    #include <iostream>
    #include <cstdlib>
    using namespace std;

    #using <System.Drawing.dll>
    using namespace System::Drawing;

    int main()
    {
    cout << "我們要測試圖檔\"Alien\"!\n";
    Bitmap im("Alien.jpg");
    int W = im.Width;
    int H = im.Height;
    cout << W << "" << H << endl;
    Bitmap im2(W, H);
    for(int x=0 ; x<W;x++)
    for (int y = 0; y < H; y++) {
    Color pp = im.GetPixel(x, y);
    int R = pp.R;
    int G = pp.G;
    int B = pp.B;
    R = (int)(0.9*R);
    G = (int)(0.5*G);

    Color p2 = Color::FromArgb(R,G,0);
    im2.SetPixel(x, y, p2);
    }
    im2.Save("Alien_B1.png");
    system("Pause");
    return 0;
    }

    回覆刪除
  22. #include
    #include

    using namespace std;

    #using
    using namespace System::Drawing;

    int main()
    {
    cout << "我們要測試圖檔\"Lena\"!\n";
    Bitmap im("C:\\Users\\a426\\Desktop\\vc\\Project1\\Project1\\lena.jpg");
    int W = im.Width;
    int H = im.Height;
    cout << W << " " << H << endl;
    Bitmap im2(W, H);
    for (int x = 0; x<W; x++)
    for (int y = 0; y < H; y++) {
    Color pp = im.GetPixel(x, y);
    int R = pp.R;
    int G = pp.G;
    int B = pp.B;
    Color p2 = Color::FromArgb(0, G, B);
    im2.SetPixel(x, y, p2);
    }
    im2.Save("lena.png");
    system("Pause");
    return 0;
    }

    回覆刪除
  23. b10433071 雷昕翰2017年12月1日 凌晨2:44

    #include
    #include

    using namespace std;

    #using
    using namespace System::Drawing;
    int main()
    {
    cout << "我們要測試圖檔\"Lena\"!\n";
    Bitmap im("lena.jpg");
    int W = im.Width;
    int H = im.Height;
    cout << W << " " << H << endl;
    Bitmap im2(W, H);
    for(int x=0;x<W;x++)
    for (int y = 0; y < H; y++) {
    Color pp = im.GetPixel(x, y);
    int R = pp.R;
    int G = pp.G;
    int B = pp.B;
    Color p2 = Color::FromArgb(0, G, B);
    im2.SetPixel(x, y, p2);
    }
    im2.Save("lena_Z.png");
    system("Pause");
    return 0;
    }

    回覆刪除
  24. b10433088葉凱文2017年12月4日 下午1:32

    #include
    #include

    using namespace std;

    #using
    using namespace System::Drawing;
    int main()
    {
    cout << "我們要測試圖檔\"Lena\"!\n";
    Bitmap im("lena.jpg");
    int W = im.Width;
    int H = im.Height;
    cout << W << " " << H << endl;
    Bitmap im2(W, H);
    for(int x=0;x<W;x++)
    for (int y = 0; y < H; y++) {
    Color pp = im.GetPixel(x, y);
    int R = pp.R;
    int G = pp.G;
    int B = pp.B;
    Color p2 = Color::FromArgb(0, G, B);
    im2.SetPixel(x, y, p2);
    }
    im2.Save("lena_Z.png");
    system("Pause");
    return 0;
    }

    回覆刪除
  25. B10537208楊蕊筑2017年12月5日 下午4:21

    #include
    #include

    using namespace std;

    #using
    using namespace System::Drawing;
    int main()
    {
    cout << "我們要測試圖檔\"Lena\"!\n";
    Bitmap im("lena.jpg");
    int W = im.Width;
    int H = im.Height;
    cout << W << " " << H << endl;
    Bitmap im2(W, H);
    for(int x=0;x<W;x++)
    for (int y = 0; y < H; y++) {
    Color pp = im.GetPixel(x, y);
    int R = pp.R;
    int G = pp.G;
    int B = pp.B;
    Color p2 = Color::FromArgb(0, G, B);
    im2.SetPixel(x, y, p2);
    }
    im2.Save("lena_Z.png");
    system("Pause");
    return 0;
    }

    回覆刪除
  26. B10533088葉俊江2017年12月5日 下午4:23

    #include
    #include

    using namespace std;

    #using
    using namespace System::Drawing;
    int main()
    {
    cout << "我們要測試圖檔\"Lena\"!\n";
    Bitmap im("lena.jpg");
    int W = im.Width;
    int H = im.Height;
    cout << W << " " << H << endl;
    Bitmap im2(W, H);
    for(int x=0;x<W;x++)
    for (int y = 0; y < H; y++) {
    Color pp = im.GetPixel(x, y);
    int R = pp.R;
    int G = pp.G;
    int B = pp.B;
    Color p2 = Color::FromArgb(0, G, B);
    im2.SetPixel(x, y, p2);
    }
    im2.Save("lena_Z.png");
    system("Pause");
    return 0;
    }

    回覆刪除
  27. B10537208楊蕊筑2017年12月5日 下午4:24

    #include
    #include

    using namespace std;

    #using
    using namespace System::Drawing;
    int main()
    {
    cout << "我們要測試圖檔\"Lena\"!\n";
    Bitmap im("lena.jpg");
    int W = im.Width;
    int H = im.Height;
    cout << W << " " << H << endl;
    Bitmap im2(W, H);
    for(int x=0;x<W;x++)
    for (int y = 0; y < H; y++) {
    Color pp = im.GetPixel(x, y);
    int R = pp.R;
    int G = pp.G;
    int B = pp.B;
    Color p2 = Color::FromArgb(0, G, B);
    im2.SetPixel(x, y, p2);
    }
    im2.Save("lena_Z.png");
    system("Pause");
    return 0;
    }

    回覆刪除
  28. B10533071徐琮淇2017年12月6日 下午2:15

    #include
    #include

    using namespace std;

    #using
    using namespace System::Drawing;
    int main()
    {
    cout << "我們要測試圖檔\"Lena\"!\n";
    Bitmap im("lena.jpg");
    int W = im.Width;
    int H = im.Height;
    cout << W << " " << H << endl;
    Bitmap im2(W, H);
    for(int x=0;x<W;x++)
    for (int y = 0; y < H; y++) {
    Color pp = im.GetPixel(x, y);
    int R = pp.R;
    int G = pp.G;
    int B = pp.B;
    Color p2 = Color::FromArgb(0, G, B);
    im2.SetPixel(x, y, p2);
    }
    im2.Save("lena_Z.png");
    system("Pause");
    return 0;
    }

    回覆刪除
  29. B10533088葉俊江2017年12月6日 下午2:16

    #include
    #include

    using namespace std;

    #using
    using namespace System::Drawing;
    int main()
    {
    cout << "我們要測試圖檔\"Lena\"!\n";
    Bitmap im("lena.jpg");
    int W = im.Width;
    int H = im.Height;
    cout << W << " " << H << endl;
    Bitmap im2(W, H);
    for(int x=0;x<W;x++)
    for (int y = 0; y < H; y++) {
    Color pp = im.GetPixel(x, y);
    int R = pp.R;
    int G = pp.G;
    int B = pp.B;
    Color p2 = Color::FromArgb(0, G, B);
    im2.SetPixel(x, y, p2);
    }
    im2.Save("lena_Z.png");
    system("Pause");
    return 0;
    }

    回覆刪除
  30. b10333093徐子軒2017年12月7日 下午6:09

    #include<iostream>
    #include<cstdlib>

    using namespace std;

    #using <System.Drawing.dll>
    using namespace System::Drawing;
    int main()
    {
    cout << "我們要測試圖檔\"Lena\"!\n";
    Bitmap im("lena.jpg");
    int W = im.Width;
    int H = im.Height;
    cout << W << "\t" << H << endl;
    Bitmap im2(W, H);
    for (int x = 0; x<W; x++)
    for (int y = 0; y < H; y++) {
    Color pp = im.GetPixel(x, y);
    int R = pp.R;
    int G = pp.G;
    int B = pp.B;
    Color p2 = Color::FromArgb(0, G, B);
    im2.SetPixel(x, y, p2);
    }
    im2.Save("lena_Z.png");
    system("Pause");
    return 0;
    }

    回覆刪除
  31. #include
    #include
    using namespace std;
    #using
    using namespace System::Drawing;
    //Bitmap 類別
    //https://msdn.microsoft.com/zh-tw/library/system.drawing.bitmap(v=vs.110).aspx
    int main() {
    cout << "我們要測試圖檔:lena\n";
    Bitmap im("lena.jpg");
    int W = im.Width;
    int H = im.Height;
    cout << "H=" << H << "\nW=" << W<<endl;
    Bitmap im2(W,H );
    for (int x = 0; x < W; x++) {
    for (int y = 0; y < H; y++) {
    Color pp = im.GetPixel(x, y);
    int R = pp.R;
    int G = pp.G;
    int B = pp.B;
    Color pp2 = Color::FromArgb(0, G, B);
    im2.SetPixel(x, y, pp2);
    }
    }
    im2.Save("lena_C.png");
    system("Pause");
    return 0;
    }

    回覆刪除
  32. b10533075 陳詔瑋2017年12月27日 下午2:52

    #include
    #include
    using namespace std;
    #using
    using namespace System::Drawing;
    int main()
    {
    cout << "喔喔喔!!!\"ooo\"!\n";
    Bitmap im("000.jpg");
    int W = im.Width;
    int H = im.Height;
    cout << W << "/"<< H << endl;
    Bitmap im2(W,H);
    for (int x = 0; x < W; x++)
    for (int y = 0; y < H; y++) {
    Color pp = im.GetPixel(x, y);
    int R = pp.R;
    int G = pp.G;
    int B = pp.B;
    Color p2 = Color::FromArgb(R,0,B);
    im2.SetPixel(x, y, p2);
    }
    im2.Save("000_0.JPG");
    system("Pause");
    return 0;
    }

    回覆刪除
  33. b10533029 游淑娥2017年12月27日 下午2:53

    #include
    #include
    using namespace std;
    #using
    using namespace System::Drawing;
    int main()
    {
    cout << "喔喔喔!!!\"ooo\"!\n";
    Bitmap im("000.jpg");
    int W = im.Width;
    int H = im.Height;
    cout << W << "/"<< H << endl;
    Bitmap im2(W,H);
    for (int x = 0; x < W; x++)
    for (int y = 0; y < H; y++) {
    Color pp = im.GetPixel(x, y);
    int R = pp.R;
    int G = pp.G;
    int B = pp.B;
    Color p2 = Color::FromArgb(R,0,B);
    im2.SetPixel(x, y, p2);
    }
    im2.Save("000_0.JPG");
    system("Pause");
    return 0;
    }

    回覆刪除
  34. B10533076 姜國傑2017年12月27日 下午5:11

    #include
    #include

    using namespace std;

    #using
    using namespace System::Drawing;
    int main()
    {
    cout << "我們要測試圖檔\"Lena\"!\n";
    Bitmap im("lena.jpg");
    int W = im.Width;
    int H = im.Height;
    cout << W << " " << H << endl;
    Bitmap im2(W, H);
    for(int x=0;x<W;x++)
    for (int y = 0; y < H; y++) {
    Color pp = im.GetPixel(x, y);
    int R = pp.R;
    int G = pp.G;
    int B = pp.B;
    Color p2 = Color::FromArgb(0, G, B);
    im2.SetPixel(x, y, p2);
    }
    im2.Save("lena_Z.png");
    system("Pause");
    return 0;
    }

    回覆刪除

HTML 編輯器