void __fastcall TDataModule_Vision::OriginalLoadBMPFile_JPG(AnsiString filePath,
TImage *img, double r, double g, double b)
{
TJPEGImage *tempJpg = new TJPEGImage();
TImage *tempImg = new TImage(Owner);
TRect ARect;
tempJpg->LoadFromFile(filePath);
tempImg->Width = 2560;
tempImg->Height = 1920;
ARect = Rect(0, 0, tempImg->Width, tempImg->Height);
tempImg->Canvas->StretchDraw(ARect, tempJpg);
tempJpg->Assign(tempImg->Picture->Bitmap);
SetStretchBltMode(img->Canvas->Handle, HALFTONE);
StretchBlt(img->Canvas->Handle, 0, 0, img->Width, img->Height,
tempImg->Canvas->Handle, 0, 0, tempImg->Width, tempImg->Height, SRCCOPY);
while(filePath.Pos("\\")) filePath.Delete(1, filePath.Pos("\\"));
m_filePath = filePath;
SetGrayColorInfo(tempImg, r, g, b);
delete tempImg;
}
TImage *img, double r, double g, double b)
{
TJPEGImage *tempJpg = new TJPEGImage();
TImage *tempImg = new TImage(Owner);
TRect ARect;
tempJpg->LoadFromFile(filePath);
tempImg->Width = 2560;
tempImg->Height = 1920;
ARect = Rect(0, 0, tempImg->Width, tempImg->Height);
tempImg->Canvas->StretchDraw(ARect, tempJpg);
tempJpg->Assign(tempImg->Picture->Bitmap);
SetStretchBltMode(img->Canvas->Handle, HALFTONE);
StretchBlt(img->Canvas->Handle, 0, 0, img->Width, img->Height,
tempImg->Canvas->Handle, 0, 0, tempImg->Width, tempImg->Height, SRCCOPY);
while(filePath.Pos("\\")) filePath.Delete(1, filePath.Pos("\\"));
m_filePath = filePath;
SetGrayColorInfo(tempImg, r, g, b);
delete tempImg;
}
댓글