|
JPEG 이미지를 TImage에 로드한 후 이미지 정보를
BYTE* 버퍼에 저장하고 싶습니다. 잘 않되네요....
그리고 저장해둔 BYTE* 버퍼의 데이터를 TImage에 다시 뿌리고 싶습니다.
방법이 없을까요..물론 제가 모르고 있겠죠.
답변 부탁드립니다.
수고하십시오.
제가 코딩한 소스인데...ㅠㅠ
Byte *ptr;
try
{
for (int y = 0; y < pBitmap->Height; y++)
{
ptr = (Byte *)pBitmap->ScanLine[y];
for (int x = 0; x < pBitmap->Width; x++) ptr[x] = (Byte)y;
}
Canvas->Draw(0,0,pBitmap);
}
catch (...)
{
ShowMessage("Could not load or alter bitmap");
}
delete pBitmap;
TMemoryStream *MyStream = new TMemoryStream();
MyStream->WriteBuffer(ptr, sizeof(ptr));
Image1->Picture->Bitmap->LoadFromStream(MyStream);
delete MyStream;
|