![]()
![]()
![]()
Ecco quello che sono riuscito a fare.
Da ieri sera ad ora ho provato a fare quello che mi hai detto tu e visto che non sono molto pratico di funzioni ho modificato ile esistenti e dopo 3 ore di lavoro ho concluso questo sorgente(k viene compilato ma non si esegue)
#include <stdio.h>
#include <windows.h>
DWORD error=0;
BOOL main( )
{
int nWidth=2;
int nHeight=2;
HDC memDC = CreateCompatibleDC(NULL);
BITMAPINFO i;
ZeroMemory(&i.bmiHeader, sizeof(BITMAPINFOHEADER) );
//--------------------------------------------------------------------
RGBTRIPLE *lprgbSrc1, *lprgbSrc2, *lprgbDst;
DWORD dwWidthBytes, dwWeight2;
int x, y;
int dwSourceWeight;
/* // Only values between 0 and 255 are valid.
if (dwWeight1 > 255) return FALSE;
// Get weighting value for second source image.
dwWeight2 = 255-dwWeight1;
*/
lprgbSrc1 = (RGBTRIPLE *)memDC/* .bmBits */;
lprgbSrc2 = (RGBTRIPLE *)memDC;
lprgbDst = (RGBTRIPLE *)memDC/* bmDst.bmBits */;
int a,b,c;
lprgbSrc1 = (RGBTRIPLE *)((LPBYTE)lprgbSrc1 + dwWidthBytes);
for ( y=1; y<80; y++) {MessageBox(NULL, "a", "GREEN", 0);
for ( x=1; x<128; x++) {MessageBox(NULL, "b", "GREEN", 0);
lprgbDst[x].rgbtRed = MessageBox(NULL, "c1", "GREEN", 0);
a=/*((*/((BYTE) lprgbSrc1[x].rgbtRed )/** dwWeight1*/ /*+
((DWORD)lprgbSrc2[x].rgbtRed * dwWeight2)) >> 8)*/;
lprgbDst[x].rgbtGreen = MessageBox(NULL, "c2", "GREEN", 0);
b=(/*((*/(BYTE)lprgbSrc1[x].rgbtGreen /** dwWeight1*/) /*+
((DWORD)lprgbSrc2[x].rgbtGreen * dwWeight2)) >> 8)*/;
lprgbDst[x].rgbtBlue =
c=(/*((*/(BYTE)lprgbSrc1[x].rgbtBlue /** dwWeight1*/)/* +
((DWORD)lprgbSrc2[x].rgbtBlue * dwWeight2)) >> 8)*/;
MessageBox(NULL, "c", "GREEN", 0);
}
MessageBox(NULL, "d", "GREEN", 0);
lprgbSrc1 = (RGBTRIPLE *)((LPBYTE)lprgbSrc1 + dwWidthBytes);
lprgbSrc2 = (RGBTRIPLE *)((LPBYTE)lprgbSrc2 + dwWidthBytes);
lprgbDst = (RGBTRIPLE *)((LPBYTE)lprgbDst + dwWidthBytes);
//--------------------------------------------------------------------
VOID *pvBits;
MessageBox(NULL, "e", "GREEN", 0);
error=0;
HBITMAP h = CreateDIBSection(memDC, &i, DIB_RGB_COLORS, &pvBits, NULL, 0);
error=GetLastError();
if (h==NULL)
{
DeleteDC(memDC);
return 1;
}
DeleteObject(h);
DeleteDC(memDC);
return 0;
}
}
Cos'è che non va??????
E' giusto quello che ho fatto.
Non sono riuscito a creare bitblt quindi visto k tu sei più bravo mi potrsti aiutare te che tutta oggi e ieri che fallisco???