Click here to Skip to main content
15,905,963 members
Home / Discussions / Graphics
   

Graphics

 
AnswerRe: GDI+ refresh image (C++) Pin
Tim Craig11-Jan-09 17:03
Tim Craig11-Jan-09 17:03 
GeneralRe: GDI+ refresh image (C++) [modified] Pin
Valdyr11-Jan-09 23:25
Valdyr11-Jan-09 23:25 
GeneralRe: GDI+ refresh image (C++) Pin
Tim Craig12-Jan-09 9:53
Tim Craig12-Jan-09 9:53 
GeneralRe: GDI+ refresh image (C++) Pin
Valdyr12-Jan-09 13:46
Valdyr12-Jan-09 13:46 
QuestionRe: GDI+ refresh image (C++) [modified] Pin
Valdyr13-Jan-09 1:46
Valdyr13-Jan-09 1:46 
AnswerRe: GDI+ refresh image (C++) Pin
Mark Salsbery13-Jan-09 6:38
Mark Salsbery13-Jan-09 6:38 
GeneralRe: GDI+ refresh image (C++) Pin
Valdyr13-Jan-09 9:07
Valdyr13-Jan-09 9:07 
GeneralRe: GDI+ refresh image (C++) Pin
Mark Salsbery13-Jan-09 9:27
Mark Salsbery13-Jan-09 9:27 
OK I've gone through your posts....there's so much contradicting information it
makes it really hard to follow Smile | :)

From all I can see, you are not using .NET and you're not using MFC.

If your window redraws fine when you resize it, move it, or move another window over
and then off it, then your WM_PAINT handler code is working fine.

Here's the code I have so far:
void Prikaz(HDC hdc){
    Graphics graphics(hdc);
    Render();
    Bitmap FrameBuffer((BITMAPINFO*) &((*BMPSlika).InfoHeader), (*BMPSlika).PixelData);
    graphics.DrawImage(&FrameBuffer,0,0);
}

LRESULT CALLBACK WndProc(HWND hWnd, UINT message, 
   WPARAM wParam, LPARAM lParam){
   PAINTSTRUCT  ps;
   HDC			hdc;
   switch(message){
   case WM_PAINT:
	 hdc = BeginPaint(hWnd, &ps);	 
	 Prikaz(hdc, hWnd);
      return 0;
   case WM_DESTROY:
      PostQuitMessage(0);
	  SnimiBitmap();
      return 0;
   default:
      return DefWindowProc(hWnd, message, wParam, lParam);
   }

Prikaz() is only called from the WM_PAINT handler code, correct?

How many places is Render() called from?

If you call an Invalidate function from Render() to force a repaint of
the window (or a portion of the window) then you'll have an infinite redraw
loop, which will really slow down your UI Smile | :)

So if you're calling Render() perhaps from another thread that is updating the bitmap,
then the code making the call to Render() should then call an invalidate function
like InvalidateRect() to tell the system it should send another WM_PAINT.

Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: GDI+ refresh image (C++) Pin
Valdyr13-Jan-09 10:06
Valdyr13-Jan-09 10:06 
GeneralRe: GDI+ refresh image (C++) Pin
Mark Salsbery13-Jan-09 18:53
Mark Salsbery13-Jan-09 18:53 
GeneralRe: GDI+ refresh image (C++) Pin
Valdyr14-Jan-09 8:48
Valdyr14-Jan-09 8:48 
GeneralRe: GDI+ refresh image (C++) Pin
Mark Salsbery14-Jan-09 8:59
Mark Salsbery14-Jan-09 8:59 
GeneralRe: GDI+ refresh image (C++) Pin
Valdyr14-Jan-09 9:09
Valdyr14-Jan-09 9:09 
GeneralRe: GDI+ refresh image (C++) Pin
Tim Craig14-Jan-09 8:39
Tim Craig14-Jan-09 8:39 
GeneralRe: GDI+ refresh image (C++) Pin
Valdyr14-Jan-09 8:58
Valdyr14-Jan-09 8:58 
AnswerRe: GDI+ refresh image (C++) Pin
Valdyr14-Jan-09 9:07
Valdyr14-Jan-09 9:07 
Question[OpenGL] multithread drawing Pin
King Tran10-Jan-09 15:58
King Tran10-Jan-09 15:58 
AnswerRe: [OpenGL] multithread drawing Pin
xavierkj13-Jul-09 0:35
xavierkj13-Jul-09 0:35 
QuestionProgrammatically Detecting GPU Specs (shading processors) Pin
Daniel Sparks7-Jan-09 8:11
Daniel Sparks7-Jan-09 8:11 
QuestionSIP phone and Flash Pin
bigphish1-Jan-09 21:43
bigphish1-Jan-09 21:43 
QuestionAdding a jpeg to a postscript file Pin
guruthos1-Jan-09 12:09
guruthos1-Jan-09 12:09 
Questionopen gl: getting texture dimensions from a texture handle Pin
Jim Crafton30-Dec-08 13:11
Jim Crafton30-Dec-08 13:11 
AnswerRe: open gl: getting texture dimensions from a texture handle Pin
El Corazon1-Jan-09 6:59
El Corazon1-Jan-09 6:59 
GeneralRe: open gl: getting texture dimensions from a texture handle Pin
Jim Crafton1-Jan-09 7:08
Jim Crafton1-Jan-09 7:08 
QuestionJPEG compression utility Pin
jesarg29-Dec-08 15:47
jesarg29-Dec-08 15:47 

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.