-
March 18th, 2013, 06:35 AM
#1
StretchDIBits
I write a software that take screen shots from remote PCs but when the screen is displayed at my window the remote screen is distorted and i can't' view the remote screen! This is part of teh code of the client that capture remote screens:
BITMAPINFO BMPInfo;
BMPInfo.bmiHeader.biSize = sizeof(BITMAPINFO);
BMPInfo.bmiHeader.biWidth = Horz;
BMPInfo.bmiHeader.biHeight = Vert;
BMPInfo.bmiHeader.biBitCount = CPP;
BMPInfo.bmiHeader.biPlanes = BitPlanes;
BMPInfo.bmiHeader.biSizeImage = Horz * Vert * 4;
BMPInfo.bmiHeader.biCompression = BI_RGB;
BMPInfo.bmiHeader.biClrUsed = 24;
BMPInfo.bmiHeader.biClrImportant = 0;
HDC Mdc = GetDC(GetDlgItem(Spy,IDC_STATIC1));
HWND mDlg = GetDlgItem(Spy,IDC_STATIC1);
GetClientRect(mDlg,&rect);
StretchDIBits(
Mdc, // handle to DC
NULL, // x-coord of destination upper-left corner
NULL, // y-coord of destination upper-left corner
rect.right, // width of destination rectangle
rect.bottom, // height of destination rectangle
NULL, // x-coord of source upper-left corner
NULL, // y-coord of source upper-left corner
Horz, // width of source rectangle
Vert, // height of source rectangle
(CONST void *)BufOfPixels, // bitmap bits
&BMPInfo, // bitmap data
DIB_RGB_COLORS, // usage options
SRCCOPY // raster operation code
);
*** this code don't works??? Where is wrong???
-
March 18th, 2013, 08:52 AM
#2
Re: StretchDIBits
W T F NOBODY ANSWER??? I AM ALREADY OUTBREAK!!! ANSWER NOW I HAVE IMPATIENCE
Last edited by Steve R Jones; March 26th, 2013 at 08:14 AM.
-
March 18th, 2013, 09:05 AM
#3
Re: StretchDIBits
If you have nothing to do while waiting for an answer then please, read the Announcement: Before you post....
And BTW, why do you think the others would have a lot of patience trying to read/understand your absolutely unreadable code snippet and absolutely uninfornative problem description?
Victor Nijegorodov
-
March 18th, 2013, 09:17 AM
#4
Re: StretchDIBits
Originally Posted by VictorN
If you have nothing to do while waiting for an answer then please, read the Announcement: Before you post....
And BTW, why do you think the others would have a lot of patience trying to read/understand your absolutely unreadable code snippet and absolutely uninfornative problem description?
***** you make me fly off the handle!
YOU ARE THE *****EST IN THE WORLD!
I'LL BLOW UP YOUR HEAD AND I BLOW UP YOUR CORNOS IF YOU DON'T SAY SORRY TO ME NOW!!!
YOU CA'T COMPROBE TEH LIES THAT YOU'VE SAY!
Last edited by Steve R Jones; March 26th, 2013 at 08:13 AM.
-
March 18th, 2013, 09:47 AM
#5
Re: StretchDIBits
Excuse me, but for such types of posts you may be banned.
Victor Nijegorodov
-
March 18th, 2013, 11:09 PM
#6
Re: StretchDIBits
Originally Posted by Haker
Code:
BITMAPINFO BMPInfo;
BMPInfo.bmiHeader.biSize = sizeof(BITMAPINFO);
BMPInfo.bmiHeader.biWidth = Horz;
BMPInfo.bmiHeader.biHeight = Vert;
BMPInfo.bmiHeader.biBitCount = CPP;
BMPInfo.bmiHeader.biPlanes = BitPlanes;
BMPInfo.bmiHeader.biSizeImage = Horz * Vert * 4;
BMPInfo.bmiHeader.biCompression = BI_RGB;
BMPInfo.bmiHeader.biClrUsed = 24;
BMPInfo.bmiHeader.biClrImportant = 0;
What is CPP?
What is BitPlanes? This should be 1.
Unless CPP is 32, BMPInfo.bmiHeader.biSizeImage is miscalculated.
Why do you set BMPInfo.bmiHeader.biClrUsed to 24? This is saying that you want to use a color palette with 24 entries, but you do not define any entries. Did you mean to set BMPInfo.bmiHeader.biBitCount to 24?
For future reference, please enclose your code between [CODE] and [/CODE] tags.
-
March 19th, 2013, 06:36 AM
#7
Re: StretchDIBits
Originally Posted by Coder Dave
What is CPP?
What is BitPlanes? This should be 1.
Unless CPP is 32, BMPInfo.bmiHeader.biSizeImage is miscalculated.
Why do you set BMPInfo.bmiHeader.biClrUsed to 24? This is saying that you want to use a color palette with 24 entries, but you do not define any entries. Did you mean to set BMPInfo.bmiHeader.biBitCount to 24?
For future reference, please enclose your code between [CODE] and [/CODE] tags.
I already modified my code but the image is still distorted! Here teh code:
Code:
BITMAPINFO BMPInfo;
memset((void *)&BMPInfo,0,sizeof(BITMAPINFO));
BMPInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
BMPInfo.bmiHeader.biWidth = Horz;
BMPInfo.bmiHeader.biHeight = Vert;
BMPInfo.bmiHeader.biBitCount = CPP;
BMPInfo.bmiHeader.biPlanes = BitPlanes;
BMPInfo.bmiHeader.biSizeImage = 0;
BMPInfo.bmiHeader.biCompression = BI_RGB;
BMPInfo.bmiHeader.biClrUsed = 0;
BMPInfo.bmiHeader.biClrImportant = 0;
HDC Mdc = GetDC(GetDlgItem(Spy,IDC_STATIC1));
HWND mDlg = GetDlgItem(Spy,IDC_STATIC1);
GetClientRect(mDlg,&rect);
StretchDIBits(
Mdc, // handle to DC
NULL, // x-coord of destination upper-left corner
NULL, // y-coord of destination upper-left corner
rect.right, // width of destination rectangle
rect.bottom, // height of destination rectangle
NULL, // x-coord of source upper-left corner
NULL, // y-coord of source upper-left corner
Head.HAD, // width of source rectangle
Head.VAD, // height of source rectangle
(CONST void *)BufOfPels, // bitmap bits
(CONST BITMAPINFO *)&BMPInfo, // bitmap data
DIB_RGB_COLORS, // usage options
SRCCOPY // raster operation code
);
WHERE Horz,Vert ARE THE HORIZONTAL AND VERTICAL ACTIVE DISPLAY FROM THE SERVER, CPP IS THE COLORS PER PIXEL FROM SERVER AND BIT PLANES IS 1
Where is the error???
Last edited by Haker; March 19th, 2013 at 06:48 AM.
-
April 26th, 2013, 09:42 PM
#8
Re: StretchDIBits
Originally Posted by Haker
***** you make me fly off the handle!
YOU ARE THE *****EST IN THE WORLD!
I'LL BLOW UP YOUR HEAD AND I BLOW UP YOUR CORNOS IF YOU DON'T SAY SORRY TO ME NOW!!!
Threats are not tolerated on this forum.
-----------------------------------------------
Brad! Jones,
Yowza Publishing
LotsOfSoftware, LLC
-----------------------------------------------
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|