Click here to Skip to main content
15,885,365 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Simple Poygons(>2) union Pin
Code-o-mat30-Jun-10 1:22
Code-o-mat30-Jun-10 1:22 
GeneralRe: Simple Poygons(>2) union Pin
Shunya30-Jun-10 1:39
Shunya30-Jun-10 1:39 
GeneralRe: Simple Poygons(>2) union Pin
Code-o-mat30-Jun-10 2:12
Code-o-mat30-Jun-10 2:12 
GeneralRe: Simple Poygons(>2) union Pin
Shunya30-Jun-10 2:53
Shunya30-Jun-10 2:53 
QuestionControl move from original position Pin
MsmVc29-Jun-10 0:58
MsmVc29-Jun-10 0:58 
QuestionHow to set the value in ComboBox Pin
raju_shiva29-Jun-10 0:55
raju_shiva29-Jun-10 0:55 
AnswerRe: How to set the value in ComboBox Pin
MsmVc29-Jun-10 1:03
MsmVc29-Jun-10 1:03 
Questionproblem with image scaning & displaing . win32 StretchDIBits () Pin
ashish8patil29-Jun-10 0:25
ashish8patil29-Jun-10 0:25 
Hello All,

General Idea:- I am developing application win32 cleint server type (It is like desktop monitoring ).

On server side I am takeing screen shot. & sending it to client side.

On server side I have function code like
--------------------------------------------
|
|
|

<pre><pre>hdc1 = GetDC(NULL);
hdc2 = CreateCompatibleDC(hdc1);
GetWindowRect(GetDesktopWindow(), &amp;rc);
w = rc.right-rc.left;
h = rc.bottom-rc.top;
bmih.biSize = sizeof(BITMAPINFOHEADER);
bmih.biWidth = w;
bmih.biHeight = h;
bmih.biPlanes = 1;
bmih.biBitCount = 24;
bmih.biCompression = BI_RGB;
bmih.biSizeImage = ((((bmih.biWidth * bmih.biBitCount) + 31) &amp; ~31) &gt;&gt; 3) * bmih.biHeight;
bi.bmiHeader = bmih;
aBmp = CreateDIBSection(hdc1, &amp;bi ,DIB_RGB_COLORS, (void**)&amp;dibvalues, NULL, NULL);
OldObj = SelectObject(hdc2, aBmp);
BitBlt(hdc2, 0, 0, w, h, hdc1, 0, 0, SRCCOPY);</pre>

//////////////////////////////////////////////////////////////</pre>



I have class like


<pre>class DesktopScreen{
public:
BITMAPINFOHEADER bmih ;
BITMAPINFO bi; unsigned char dibvalues[lenght]; };</pre>------------------------------------------------------------------

using above code I am filling Object of this class &amp; sending it to other side

in binary formate (byte).

On Client side deserializing is also OK (I check all value at time of debuging )

<pre>Now at time WM_Paint:
hDC = BeginPaint(hWnd, &amp;Ps);

i= StretchDIBits(hDC, // destination rectangle 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), // source rectangle 0, 0,desktopObj.bmih.biWidth , desktopObj.bmih.biHeight, desktopObj.dibvalues, &amp;desktopObj.bi, DIB_RGB_COLORS, SRCCOPY);
//////////////////////////////////////////////////////////////////////////</pre>

StretchDIBits is returning 0 .

Application run properlly but image is not displying.

also if i call StretchDIBits on server side passing same info to that function.I mages is displaying.


Can you please tell me what should be the problem.

( sorry for posting code ,but I think it is necessary to get my Question to you )

Thanks ,
Ashish.
QuestionOwnerdarw Combobox Pin
AbhiHcl28-Jun-10 23:33
AbhiHcl28-Jun-10 23:33 
AnswerRe: Ownerdarw Combobox Pin
Nibu babu thomas28-Jun-10 23:41
Nibu babu thomas28-Jun-10 23:41 
GeneralRe: Ownerdarw Combobox Pin
AbhiHcl28-Jun-10 23:47
AbhiHcl28-Jun-10 23:47 
GeneralRe: Ownerdarw Combobox Pin
Nibu babu thomas28-Jun-10 23:48
Nibu babu thomas28-Jun-10 23:48 
GeneralRe: Ownerdarw Combobox Pin
AbhiHcl28-Jun-10 23:54
AbhiHcl28-Jun-10 23:54 
GeneralRe: Ownerdarw Combobox Pin
Aescleal28-Jun-10 23:59
Aescleal28-Jun-10 23:59 
GeneralRe: Ownerdarw Combobox Pin
Nibu babu thomas29-Jun-10 2:01
Nibu babu thomas29-Jun-10 2:01 
AnswerRe: Ownerdarw Combobox Pin
Aescleal28-Jun-10 23:58
Aescleal28-Jun-10 23:58 
Questionswap different sized string Pin
rupeshkp72828-Jun-10 22:05
rupeshkp72828-Jun-10 22:05 
AnswerRe: swap different sized string Pin
Cedric Moonen28-Jun-10 22:14
Cedric Moonen28-Jun-10 22:14 
GeneralRe: swap different sized string Pin
rupeshkp72828-Jun-10 22:26
rupeshkp72828-Jun-10 22:26 
GeneralRe: swap different sized string Pin
Aescleal28-Jun-10 23:51
Aescleal28-Jun-10 23:51 
AnswerRe: swap different sized string Pin
Adam Roderick J28-Jun-10 22:14
Adam Roderick J28-Jun-10 22:14 
GeneralRe: swap different sized string Pin
rupeshkp72828-Jun-10 22:40
rupeshkp72828-Jun-10 22:40 
AnswerRe: swap different sized string Pin
Niklas L28-Jun-10 22:29
Niklas L28-Jun-10 22:29 
NewsRe: swap different sized string Pin
rupeshkp72829-Jun-10 2:18
rupeshkp72829-Jun-10 2:18 
AnswerRe: swap different sized string Pin
Eugen Podsypalnikov28-Jun-10 22:30
Eugen Podsypalnikov28-Jun-10 22:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.