15.11.2011, 10:00
|
|
Let Me Show You
|
|
Регистрация: 30.04.2010
Адрес: Северодвинск
Сообщения: 5,426
Версия Delphi: 7, XE5
Репутация: 59586
|
|
Код:
var
ABitmap: TBitmap;
ADC: HDC;
ABitmapInfo: TBitmapInfo;
lpvBits: array of Byte;
begin
ABitmap:=TBitmap.Create;
try
ABitmap.LoadFromFile('0.bmp');
ADC:=CreateCompatibleDC(0);
try
ZeroMemory(@ABitmapInfo.bmiHeader, SizeOf(TBitmapInfoHeader));
ABitmapInfo.bmiHeader.biSize:=SizeOf(TBitmapInfoHeader);
if GetDIBits(ADC, ABitmap.Handle, 0, 0, nil, ABitmapInfo, DIB_RGB_COLORS)>0 then
begin
SetLength(lpvBits, ABitmapInfo.bmiHeader.biSizeImage);
if GetDIBits(ADC, ABitmap.Handle, 0, ABitmapInfo.bmiHeader.biHeight,
lpvBits, ABitmapInfo, DIB_RGB_COLORS)>0 then
begin
// lpvBits: array [0..ABitmapInfo.bmiHeader.biSizeImage-1] of R, G, B; - условно
end else ShowMessage(SysErrorMessage(GetLastError));
end else ShowMessage(SysErrorMessage(GetLastError));
finally
DeleteDC(ADC);
end;
finally
ABitmap.Free;
end;
end;
__________________
Пишу программы за еду.
__________________
|