Форум: "Media";
Текущий архив: 2002.07.08;
Скачать: [xml.tar.bz2];
ВнизБольшой BMP Найти похожие ветки
← →
microb (2002-03-04 10:22) [0]Мне нужно разрезать монохромный BMP на 16 частей, что то вроде шахматной доски, и перезаписать данные в другой файл, что бы при считывании из него рисунок выводился блоками. BMP - большой, около 10Mb.
← →
Владимир Васильев (2002-03-04 16:31) [1]FileHandle := FileOpen (FFilename, fmOpenRead + fmShareDenyNone);
if FileHandle = INVALID_HANDLE_VALUE then
raise Exception.Create ("Failed to open " + FFilename);
// create file map and throw away the file handle
try
MapHandle := CreateFileMapping (FileHandle, nil, PAGE_READONLY, 0, 0, nil);
if MapHandle = 0 then
raise Exception.Create ("Failed to map file")
finally
CloseHandle (FileHandle)
end;
// view file map and throw away the map handle
try
FData := MapViewOfFile (MapHandle, FILE_MAP_READ, 0, 0, 0);
if FData = nil then
raise Exception.Create ("Failed to view map file")
finally
CloseHandle (MapHandle)
end;
// set up a few other pointers into the data for records we will
// need to reference in the file, it"s easiest just to do it this once.
FInfoHeader := pointer (integer (FData) + sizeof (TBitmapFileHeader));
FInfo := pointer (FInfoHeader);
FPixelStart := pointer (integer(FData) + FFileHeader^.bfOffBits);
// get bitmap size into easy to access properties
FBitmapHeight := FInfoHeader^.biHeight;
FBitmapWidth := FInfoHeader^.biWidth;
//копируешь нужный кусок
StretchDIBits (TempDIB.Canvas.Handle, //destination device context.
DestR.Left,DestR.Top,W,H, //dest. rect
SrcR.Left,FBitmapHeight-SrcR.Bottom,W,H, //source rect
FPixelStart, // address of bitmap bits
FInfo^, // address of bitmap data
DIB_RGB_COLORS, SRCCOPY);
← →
Владимир Васильев (2002-03-04 16:42) [2]Полностью код забирай с
ftp://vladcommon:vladcommon@194.84.65.217
Страницы: 1 вся ветка
Форум: "Media";
Текущий архив: 2002.07.08;
Скачать: [xml.tar.bz2];
Память: 0.45 MB
Время: 0.006 c