オブジェクトにJPG画像をロードしましたImage^
が、プログラムで標準のC ++を使用するように「戻り」たいので、何らかの方法でImage ^オブジェクトを任意のオブジェクトに変換したいと思いますBMP class Object
(どのC ++クラスが適切かわかりません)。 。
そのビットマップの特定のピクセルの色を編集したいと思います。
私がそれをするのを手伝ってください。
// a.cpp : main project file.
#include "stdafx.h"
#include "Form1.h"
#using <mscorlib.dll> //requires CLI
using namespace System;
using namespace System::IO;
using namespace System::Windows::Media::Imaging;
using namespace System::Windows::Media;
using namespace System::Windows::Controls;
using namespace a;
[STAThreadAttribute]
int main(array<System::String ^> ^args)
{
// Enabling Windows XP visual effects before any controls are created
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
// Create the main window and run it
Application::Run(gcnew Form1());
// Open a Stream and decode a JPEG image
Stream^ imageStreamSource = gcnew FileStream("C:/heart.jpg", FileMode::Open, FileAccess::Read, FileShare::Read);
JpegBitmapDecoder^ decoder = gcnew JpegBitmapDecoder(imageStreamSource, BitmapCreateOptions::PreservePixelFormat, BitmapCacheOption::Default);
BitmapSource^ bitmapSource = decoder->Frames[0];//< --mamy bitmape
// Draw the Image
System::Windows::Controls::Image^ myImage = gcnew System::Windows::Controls::Image(); //<--- this image in the Form1 -------
myImage->Source = bitmapSource;
myImage->Stretch = Stretch::None;
//CONVERT MYIMAGE INTO C++ BMP
return 0;
}