Форум: "WinAPI";
Текущий архив: 2007.11.04;
Скачать: [xml.tar.bz2];
Вниз2 битмапа в 1 Найти похожие ветки
← →
Альберт © (2007-04-30 23:37) [0]есть два bitmap
один из окна (24 bit), второй - 8 bit из файла. работа только через винапи. цель составить 32 bit .
type
TScr = array [0..1] of Byte;
PScr = ^TScr;
Data = record
SIZE:DWord;
BIH:^BITMAPINFO;
DC:HDC;
HANDLE:HBITMAP;
end;
function getBitmapColorTableFromWindow(WND:HWND{; bits:PScr}):Data;
var
WND_RECT:TRECT;
hBmp : hBitmap;
DeskDC : hDC;
DC : hDC;
BFH : BITMAPFILEHEADER;
BIH : tagBITMAPINFO;
ScrX, ScrY : Integer;
ScrSize : Cardinal;
Bits : PScr;
RETURN_DATA: Data;
begin
Windows.GetWindowRect(WND,WND_RECT);
SCRX := (WND_RECT.Right - WND_RECT.Left);
SCRY := (WND_RECT.Bottom - WND_RECT.Top);
ScrSize := ScrX * ScrY * 3;
GetMem(Bits, ScrSize);
DeskDC := GetDC(WND);
hBmp := CreateCompatibleBitmap(DeskDC, ScrX, ScrY);
DC := CreateCompatibleDC(DeskDC);
SelectObject(DC, hbmp);
BitBlt(DC, 0, 0, SCRX, SCRY, DeskDC, 0, 0, SrcCopy);
with BFH do
begin
bfType := $4D42;
bfSize := SCRX * SCRY * 3 + SizeOf(BFH) + SizeOf(BIH);
bfReserved1 := 0;
bfReserved2 := 0;
bfOffBits := SizeOf(BFH) + SizeOf(BIH);
end;
with BIH.bmiHeader do
begin
biSize := sizeof(BIH);
biWidth := SCRX;
biHeight := SCRY;
biPlanes := 1;
biBitCount := 24;
biCompression := BI_RGB;
biSizeImage := ScrSize;
biClrImportant := 0;
end;
GetDiBits(DC, hbmp, 0, SCRY, Bits, BIH, DIB_RGB_COLORS);
// DeleteObject(hbmp);
GetMEM(RETURN_DATA.BIH, SizeOf(BIH));
RETURN_DATA.BIH^:=BIH;
RETURN_DATA.SIZE := ScrSize;
RETURN_DATA.DC:=DC;
RETURN_DATA.HANDLE:=hbmp;
RESULT:=RETURN_DATA;
end;
function getBitmapColorTableFromFile(pszFilename:PCHAR; bits: PSCR):Data;
var
F : FILE;
BFH : BITMAPFILEHEADER;
// BIH : ^BITMAPINFO;
COLOR_TABLE_SIZE: DWORD;
// bits: PSCR;
i:integer;
begin
assignfile(f,pszFilename);
reset(F,1);
//messageBox(asd,pchar(inttostr(COLOR_TABLE_SIZE)),pchar(inttostr((filepos(F)))),0 );
blockread(f, BFH, SizeOf(BFH));
GetMem(RESULT.BIH, BFH.bfOffBits - 14);
blockread(f,RESULT.BIH^, {filesize(f) - 14 - COLOR_TABLE_SIZE} BFH.bfOffBits - 14 );
COLOR_TABLE_SIZE := RESULT.BIH^.bmiHeader.biWidth * RESULT.BIH^.bmiHeader.biHeight * RESULT.BIH^.bmiHeader.biBitCount shr 3;
// messageBox(asd,pchar(inttostr(COLOR_TABLE_SIZE)),pchar(inttostr((filepos(F)))),0 );
GetMem(bits, COLOR_TABLE_SIZE);
blockread(f, bits^, COLOR_TABLE_SIZE, i);
// messageBox(asd,pchar(inttostr(COLOR_TABLE_SIZE)),pchar(inttostr((i))),0);
closefile(f);
RESULT.DC := GetDC(0);
RESULT.HANDLE := CreateCompatibleBitmap(RESULT.DC , RESULT.BIH^.bmiHeader.biWidth, RESULT.BIH^.bmiHeader.biHeight);
RESULT.DC := CreateCompatibleDC(RESULT.DC );
SetDiBits(RESULT.DC, RESULT.HANDLE, 0, RESULT.BIH^.bmiHeader.biHeight, bits, RESULT.BIH^, DIB_RGB_COLORS);
SelectObject(RESULT.DC, RESULT.HANDLE);
// BitBlt(getDC(0),0,0,RESULT.BIH^.bmiHeader.biWidth , RESULT.BIH^.bmiHeader.biHeight, RESULT.DC,0,0,SRCCOPY);
// messageBox(asd,pchar(inttostr((34))),"",0);
RESULT.SIZE := COLOR_TABLE_SIZE;
// àëüòåðíàòèâà // RESULT.HANDLE:=loadimage(0,pszfilename,IMAGE_BITMAP,0,0,LR_LOADFROMFILE);
end;
function createBitmap32(W, H:WORD):DATA;
var ScrSize:Cardinal;
begin
ScrSize := W * H * 4;
GETMEM(RESULT.BIH, sizeOf(tagBITMAPINFO));
with RESULT.BIH^.bmiHeader do
begin
biSize := sizeof(tagBITMAPINFO);
biWidth := W;
biHeight := H;
biPlanes := 1;
biBitCount := 32;
biCompression := BI_RGB;
biSizeImage := ScrSize;
biClrImportant := 0;
end;
RESULT.DC := GetDC(0);
RESULT.HANDLE := CreateCompatibleBitmap(RESULT.DC, W, H);
RESULT.DC := CreateCompatibleDC(RESULT.DC);
SelectObject(RESULT.DC,RESULT.HANDLE);
end;
← →
Альберт © (2007-04-30 23:38) [1]а вот и мой тупой рабочий код с
function joinBitmaps(WND:HWND; pszFilename:PCHAR ):HBITMAP;
type
TScr = array [0..1] of Byte;
PScr = ^TScr;
var
DeskDC : hDC;
DC : hDC;
BIH : tagBITMAPINFO;
Bits8,Bits24,Bits32 : Pointer;//PScr;
WND_RECT:TRECT;
hBmp8, hBmp24,hBmp32:HBITMAP;
xx, yy: Integer; // Ñ÷åò÷èêè öèêëîâ
SrcBase, {MapBase,} DstBase: Pointer; // Óêàçàòåëè íà ñòðîêè ïèêñåëåé
MapBase:pbyte;
SrcInc, MapInc, DstInc: Integer; // Ðàçìåðû ñòðîê ïèêñåëåé
SrcPixel: PRGBTriple; // ïèêñåëü 24-áèòíîé êàðòèíêè
Alpha: PByte; // ïèêñåëü 8-áèòíîé êàðòèíêè
DstPixel: PRGBQuad; // ïèêñåëü 32-áèòíîé êàðòèíêè
DST_DATA, MAP_DATA, SRC_DATA:DATA;
PreMultiplyTable: array [0..255,0..255] of Byte;
//------------------
begin
bits24:=nil;
SRC_DATA:=getBitmapColorTableFromWindow(WND);
GetMem(bits24, SRC_DATA.BIH^.bmiHeader.biSizeImage);
GetDiBits(SRC_DATA.DC, SRC_DATA.HANDLE, 0, SRC_DATA.BIH^.bmiHeader.biHeight, bits24, SRC_DATA.BIH^, DIB_RGB_COLORS);
// BitBlt(GETDC(0),0,0, SRC_DATA.BIH^.bmiHeader.biWidth, SRC_DATA.BIH^.bmiHeader.biHeight,SRC_DATA.DC,0,0,SRCCOPy);
bits8:=nil;
MAP_DATA := getBitmapColorTableFromFile(pszfilename, bits8);
GetMem(bits8, MAP_DATA.BIH^.bmiHeader.biSizeImage);
GetDiBits(MAP_DATA.DC, MAP_DATA.HANDLE, 0, MAP_DATA.BIH^.bmiHeader.biHeight, bits8, MAP_DATA.BIH^, DIB_RGB_COLORS);
// BitBlt(GETDC(0),0,0, MAP_DATA.BIH^.bmiHeader.biWidth, MAP_DATA.BIH^.bmiHeader.biHeight,MAP_DATA.DC,0,0,SRCCOPy);
DST_DATA:=createBitmap32(SRC_DATA.BIH^.bmiHeader.biWidth, SRC_DATA.BIH^.bmiHeader.biHeight);
hbmp32:=DST_DATA.HANDLE;
GetMem(bits32, DST_DATA.BIH^.bmiHeader.biSizeImage);
// alert(inttostr(1 shl 2)); // 4!
SRCBASE := @bits24;
MAPBASE := @bits8;
DSTBASE := @bits32;
{
SRCINC := SRC_DATA.BIH^.bmiHeader.biWidth * 3;
MAPINC := MAP_DATA.BIH^.bmiHeader.biWidth;
DSTINC := SRC_DATA.BIH^.bmiHeader.biWidth * 4;
}
for yy := 0 to MAP_DATA.BIH^.bmiHeader.biHeight - 1 do
for xx := 0 to MAP_DATA.BIH^.bmiHeader.biWidth - 1 do
begin
alert(inttostr(BYTE(MAPBASE^)));
MAPBASE:=MAPBASE + 1;
end;
{
for yy := 0 to DST_DATA.BIH^.bmiHeader.biHeight - 1 do begin
if yy< MAP_DATA.BIH^.bmiHeader.biHeight then
begin
end;
for xx := 0 to DST_DATA.BIH^.bmiHeader.biWidth - 1 do
begin
// if xx< MAP_DATA.BIH^.bmiHeader.biWidth then
begin
DWORD(DSTBASE^):=DWORD(SRCBASE^);//(BYTE(MAPBASE^) shl 4){ or (DWORD(SRCBASE^))}; {alpha, rgb}
{
alert(inttostr(DWORD(SRCBASE^)));
DWORD(DSTBASE ):=DWORD(DSTBASE) + 4;
DWORD(MAPBASE ):=DWORD(MAPBASE) + 1;
DWORD(SRCBASE ):=DWORD(SRCBASE) + 3;
end;
end;
end;
SetDiBits(DST_DATA.DC, hbmp32, 0, SRC_DATA.BIH^.bmiHeader.biHeight, Bits32, DST_DATA.BIH^, DIB_RGB_COLORS);
BitBlt(GetDC(0),0,0,DST_DATA.BIH^.bmiHeader.biWidth,DST_DATA.BIH^.bmiHeader.biHe ight,DST_DATA.DC,0,0,SRCCOPy);
{
for yy := 0 to DST_DATA.BIH^.bmiHeader.biHeight - 1 do begin
// Ïîëó÷àåì ïåðâûé ïèêñåëü â ñòðîêå
DWORD(SrcPixel) := DWORD(bits24);
Alpha := bits8;
DWORD(DstPixel) := DWORD(bits32);
// Ïåðåáèðàåì âñå ïèêñåëè â ñòðîêå
for xx := 0 to DST_DATA.BIH^.bmiHeader.biWidth - 1 do begin
// Óñòàíàâëèâàåì öâåòîâûå êîìïîíåíòû 32-áèòíîé êàðòèíêè, ïî
// çíà÷åíèÿì ïðåäóìíîæåííî&# 233; òàáëèöû.
DstPixel.rgbRed := PreMultiplyTable[Byte(Alpha^), SrcPixel.rgbtRed];
DstPixel.rgbGreen := PreMultiplyTable[Byte(Alpha^), SrcPixel.rgbtGreen];
DstPixel.rgbBlue := PreMultiplyTable[Byte(Alpha^), SrcPixel.rgbtBlue];
DstPixel.rgbReserved := Byte(Alpha^); // àëüôà-êàíàë áåç èçìåíåíèé
// Ïîëó÷àåì ñëåäóþùèé ïèêñåë â êàðòèíêàõ
DWORD(SrcPixel) := DWORD(SrcPixel) + SizeOf(TRGBTriple);
DWORD(DstPixel) := DWORD(DstPixel) + SizeOf(TRGBQuad);
DWORD(Alpha) := DWORD(Alpha) + SizeOf(Byte);
end;
// Ïîëó÷àåì ñëåäóþùóþ ñòðîêó
DWORD(bits24) := DWORD(bits24) + SrcInc;
DWORD(bits8) := DWORD(bits8) + MapInc;
DWORD(bits32) := DWORD(bits32) + DstInc;
end;
with BIH.bmiHeader do
begin
biSize := sizeof(BIH);
biWidth := SRC_DATA.BIH^.bmiHeader.biWidth;
biHeight := SRC_DATA.BIH^.bmiHeader.biHeight;
biPlanes := 1;
biBitCount := 32;
biCompression := BI_RGB;
biSizeImage := SRC_DATA.BIH^.bmiHeader.biWidth * 4 * SRC_DATA.BIH.bmiHeader.biHeight;
biClrImportant := 0;
end;
//DC:= CreateCompatibleDC(SRC_DATA.DC);
SetDiBits(DC, hbmp32, 0, SRC_DATA.BIH^.bmiHeader.biHeight, Bits32, BIH, DIB_RGB_COLORS);
BitBlt(DC,0,0,SRC_DATA.BIH^.bmiHeader.biWidth,SRC_DATA.BIH^.bmiHeader.biHeight,G ETDC(0),0,0,SRCCOPy);
//}
end;
← →
Альберт © (2007-05-01 14:15) [2]короче разобрался с кодом, но рисуется не то что-то
function getBitmapColorTableFromFile;
var
F : FILE;
BFH : BITMAPFILEHEADER;
COLOR_TABLE_SIZE: DWORD;
i:integer;
begin
assignfile(f,pszFilename);
reset(F,1);
blockread(f, BFH, SizeOf(BFH));
GetMem(RESULT.BIH, BFH.bfOffBits - 14);
blockread(f,RESULT.BIH^, {filesize(f) - 14 - COLOR_TABLE_SIZE} BFH.bfOffBits - 14 );
COLOR_TABLE_SIZE := RESULT.BIH^.bmiHeader.biWidth * RESULT.BIH^.bmiHeader.biHeight * RESULT.BIH^.bmiHeader.biBitCount shr 3;
GetMem(bits, COLOR_TABLE_SIZE);
blockread(f, bits^, COLOR_TABLE_SIZE, i);
closefile(f);
RESULT.DC := GetDC(0);
RESULT.HANDLE := CreateCompatibleBitmap(RESULT.DC , RESULT.BIH^.bmiHeader.biWidth, RESULT.BIH^.bmiHeader.biHeight);
RESULT.DC := CreateCompatibleDC(RESULT.DC );
SetDiBits(RESULT.DC, RESULT.HANDLE, 0, RESULT.BIH^.bmiHeader.biHeight, bits, RESULT.BIH^, DIB_RGB_COLORS);
SelectObject(RESULT.DC, RESULT.HANDLE);
RESULT.SIZE := COLOR_TABLE_SIZE;
// àëüòåðíàòèâà // RESULT.HANDLE:=loadimage(0,pszfilename,IMAGE_BITMAP,0,0,LR_LOADFROMFILE);
end;
function getBitmapColorTableFromWindow;
var
WND_RECT:TRECT;
hBmp : hBitmap;
DeskDC : hDC;
DC : hDC;
BFH : BITMAPFILEHEADER;
BIH : tagBITMAPINFO;
ScrX, ScrY : Integer;
ScrSize : Cardinal;
Bits : PScr;
RETURN_DATA: Data;
begin
Windows.GetWindowRect(WND,WND_RECT);
SCRX := (WND_RECT.Right - WND_RECT.Left);
SCRY := (WND_RECT.Bottom - WND_RECT.Top);
ScrSize := ScrX * ScrY * 3;
GetMem(Bits, ScrSize);
DeskDC := GetDC(WND);
hBmp := CreateCompatibleBitmap(DeskDC, ScrX, ScrY);
DC := CreateCompatibleDC(DeskDC);
SelectObject(DC, hbmp);
BitBlt(DC, 0, 0, SCRX, SCRY, DeskDC, 0, 0, SrcCopy);
with BFH do
begin
bfType := $4D42;
bfSize := SCRX * SCRY * 3 + SizeOf(BFH) + SizeOf(BIH);
bfReserved1 := 0;
bfReserved2 := 0;
bfOffBits := SizeOf(BFH) + SizeOf(BIH);
end;
with BIH.bmiHeader do
begin
biSize := sizeof(BIH);
biWidth := SCRX;
biHeight := SCRY;
biPlanes := 1;
biBitCount := 24;
biCompression := BI_RGB;
biSizeImage := ScrSize;
biClrImportant := 0;
end;
GetDiBits(DC, hbmp, 0, SCRY, Bits, BIH, DIB_RGB_COLORS);
// DeleteObject(hbmp);
GetMEM(RETURN_DATA.BIH, SizeOf(BIH));
RETURN_DATA.BIH^:=BIH;
RETURN_DATA.SIZE := ScrSize;
RETURN_DATA.DC:=DC;
RETURN_DATA.HANDLE:=hbmp;
RESULT:=RETURN_DATA;
end;
function createBitmap32(W, H:WORD):DATA;
var ScrSize:Cardinal;
begin
ScrSize := W * H * 4;
GETMEM(RESULT.BIH, sizeOf(tagBITMAPINFO));
with RESULT.BIH^.bmiHeader do
begin
biSize := sizeof(tagBITMAPINFO);
biWidth := W;
biHeight := H;
biPlanes := 1;
biBitCount := 32;
biCompression := BI_RGB;
biSizeImage := ScrSize;
biClrImportant := 0;
end;
RESULT.DC := GetDC(0);
RESULT.HANDLE := CreateCompatibleBitmap(RESULT.DC, W, H);
RESULT.DC := CreateCompatibleDC(RESULT.DC);
SelectObject(RESULT.DC,RESULT.HANDLE);
end;
function joinBitmaps;
var
// Bits8,Bits24,Bits32 : Pointer;//PScr;
Bits8,Bits24,Bits32 : PScr;
xx, yy: Integer; // Ñ÷åò÷èêè öèêëîâ
SrcBase, MapBase, DstBase: Pointer; // Óêàçàòåëè íà ñòðîêè ïèêñåëåé
SrcInc: Integer; // Ðàçìåðû ñòðîê ïèêñåëåé
DST_DATA, MAP_DATA, SRC_DATA:DATA;
//------------------
begin
// bits24:=nil;
SRC_DATA:=getBitmapColorTableFromWindow(WND);
GetMem(bits24, SRC_DATA.BIH^.bmiHeader.biSizeImage);
GetDiBits(SRC_DATA.DC, SRC_DATA.HANDLE, 0, SRC_DATA.BIH^.bmiHeader.biHeight, bits24, SRC_DATA.BIH^, DIB_RGB_COLORS);
// BitBlt(GETDC(0),0,0, SRC_DATA.BIH^.bmiHeader.biWidth, SRC_DATA.BIH^.bmiHeader.biHeight,SRC_DATA.DC,0,0,SRCCOPy);
bits8:=nil;
MAP_DATA := getBitmapColorTableFromFile(pszfilename, bits8);
GetMem(bits8, MAP_DATA.BIH^.bmiHeader.biSizeImage);
GetDiBits(MAP_DATA.DC, MAP_DATA.HANDLE, 0, MAP_DATA.BIH^.bmiHeader.biHeight, bits8, MAP_DATA.BIH^, DIB_RGB_COLORS);
// BitBlt(GETDC(0),0,0, MAP_DATA.BIH^.bmiHeader.biWidth, MAP_DATA.BIH^.bmiHeader.biHeight,MAP_DATA.DC,0,0,SRCCOPy);
DST_DATA:=createBitmap32(MAP_DATA.BIH^.bmiHeader.biWidth, MAP_DATA.BIH^.bmiHeader.biHeight);
GetMem(bits32, DST_DATA.BIH^.bmiHeader.biSizeImage);
// alert(inttostr(1 shl 2)); // 4!
SRCBASE := bits24;
MAPBASE := bits8;
DSTBASE := bits32;
SRCINC := SRC_DATA.BIH^.bmiHeader.biWidth * 3;
for yy := 0 to MAP_DATA.BIH^.bmiHeader.biHeight - 1 do
begin
for xx := 0 to MAP_DATA.BIH^.bmiHeader.biWidth - 1 do
begin
// alert(inttostr(BYTE(MAPBASE^)));
DWORD(DSTBASE^):=DWORD(SRCBASE^) { + BYTE(MAPBASE^) shl 4};
{ alert(inttostr(BYTE (MAPBASE^)));
alert(inttostr(DWORD(SRCBASE^)));
alert(inttostr(DWORD(DSTBASE^)));
alert("ok");
//}
DWORD(MAPBASE) :=DWORD(MAPBASE) + 1;
DWORD(SRCBASE) :=DWORD(SRCBASE) + 3;
DWORD(DSTBASE) :=DWORD(DSTBASE) + 4;
if xx>=SRC_DATA.BIH^.bmiHeader.biWidth then
begin
DWORD(SRCBASE):=DWORD(bits24)+DWORD((yy+1)*SRCINC);
break;
end;
end;
end;
SetDiBits(MAP_DATA.DC, DST_DATA.HANDLE, 0, SRC_DATA.BIH^.bmiHeader.biHeight, Bits32, SRC_DATA.BIH^, DIB_RGB_COLORS);
BitBlt(GETDC(0),0,300,DST_DATA.BIH^.bmiHeader.biWidth,DST_DATA.BIH^.bmiHeader.bi Height,DST_DATA.DC,0,0,SRCCOPy);
result:=0;
end;
← →
DVM © (2007-05-01 15:53) [3]А в чем проблема то была?
← →
Albert s sotovogo (2007-05-01 20:18) [4]ne risuet normalno. teoreti4eski v 32 bitnom risuetsya tolko 24 bitnaya 4ast. a 8 bitnaya primenyaetsya dlya mnogosloinix okon.
predposlednyaya stroka s bitblt
← →
Альберт © (2007-05-02 20:42) [5]переписал joinbitmaps
function joinBitmaps;
var
Bits8,Bits24,Bits32:pointer;
xx, yy: Integer; // Ñ÷åò÷èêè öèêëîâ
SrcBase, MapBase, DstBase: Pointer; // Óêàçàòåëè íà ñòðîêè ïèêñåëåé
SrcInc: Integer; // Ðàçìåðû ñòðîê ïèêñåëåé
DST_DATA, MAP_DATA, SRC_DATA:DATA;
//------------------
begin
SRC_DATA:=getBitmapColorTableFromWindow(WND);
GetMem(bits24, SRC_DATA.BIH^.bmiHeader.biSizeImage);
GetDiBits(SRC_DATA.DC, SRC_DATA.HANDLE, 0, SRC_DATA.BIH^.bmiHeader.biHeight, bits24, SRC_DATA.BIH^, DIB_RGB_COLORS);
bits8:=nil;
MAP_DATA := getBitmapColorTableFromFile(pszfilename, bits8);
GetMem(bits8, MAP_DATA.BIH^.bmiHeader.biSizeImage);
GetDiBits(MAP_DATA.DC, MAP_DATA.HANDLE, 0, MAP_DATA.BIH^.bmiHeader.biHeight, bits8, MAP_DATA.BIH^, DIB_RGB_COLORS);
// BitBlt(GETDC(0),0,0, MAP_DATA.BIH^.bmiHeader.biWidth, MAP_DATA.BIH^.bmiHeader.biHeight,MAP_DATA.DC,0,0,SRCCOPy);
bits32:=nil;
DST_DATA:=createBitmap32(MAP_DATA.BIH^.bmiHeader.biWidth, MAP_DATA.BIH^.bmiHeader.biHeight, bits32);
GetMem(bits32, DST_DATA.BIH^.bmiHeader.biSizeImage);
SetDiBits(DST_DATA.DC, DST_DATA.HANDLE, 0, SRC_DATA.BIH^.bmiHeader.biHeight, Bits32, SRC_DATA.BIH^, DIB_RGB_COLORS);
SRCBASE := bits24;
MAPBASE := bits8;
DSTBASE := bits32;
SRCINC := SRC_DATA.BIH^.bmiHeader.biWidth * 3;
for yy := 0 to MAP_DATA.BIH^.bmiHeader.biHeight - 1 do
begin
for xx := 0 to MAP_DATA.BIH^.bmiHeader.biWidth - 1 do
begin
DWORD(SRCBASE^) := DWORD(MAP_DATA.BIH^.bmiColors[BYTE(MAPBASE^)]) ;
DWORD(MAPBASE) :=DWORD(MAPBASE) + 1;
DWORD(SRCBASE) :=DWORD(SRCBASE) + 3;
DWORD(DSTBASE) :=DWORD(DSTBASE) + 4;
if xx>=SRC_DATA.BIH^.bmiHeader.biWidth then
begin
DWORD(SRCBASE):=DWORD(bits24)+DWORD(yy*SRCINC);
break;
end;
end;
end;
//}
// SetDiBits(MAP_DATA.DC, MAP_DATA.HANDLE, 0, MAP_DATA.BIH^.bmiHeader.biHeight, Bits8, MAP_DATA.BIH^, DIB_RGB_COLORS);
SetDiBits(SRC_DATA.DC, SRC_DATA.HANDLE, 0, SRC_DATA.BIH^.bmiHeader.biHeight, Bits24, SRC_DATA.BIH^, DIB_RGB_COLORS);
BitBlt(GETDC(0),0,200,DST_DATA.BIH^.bmiHeader.biWidth,DST_DATA.BIH^.bmiHeader.bi Height,SRC_DATA.DC,0,0,SRCCOPy);
BitBlt(GETDC(0),0,0,DST_DATA.BIH^.bmiHeader.biWidth,DST_DATA.BIH^.bmiHeader.biHe ight,MAP_DATA.DC,0,0,SRCCOPy);
result:=DST_DATA.HANDLE;
end;
← →
Альберт © (2007-05-02 20:44) [6]проблема в том, что когда переделываю из 8 битного бмп в 24 битный рисунок неправильно отображается, хотя я ссылаюсь на таблицу цветов как указано в документации
Страницы: 1 вся ветка
Форум: "WinAPI";
Текущий архив: 2007.11.04;
Скачать: [xml.tar.bz2];
Память: 0.51 MB
Время: 0.048 c