[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 242
  • Last Modified:

Graphics in Windows

Ok. I got a block of memory, char [640][480], and every character in it represents a pixel color. I want to blit this block of data to the screen. I know how to, using memcpy, but how do i get in in the right mode? I want to do this all from windows, remember. I want full screen graphics, and a mouse. I would prefer not to use DirectX. Any suggestions, site referances, code...anything? Thanks-
ty
0
TRM
Asked:
TRM
  • 3
  • 2
1 Solution
 
AlexVirochovskyCommented:
You must use for this Windows API:
BitBlt/StretchBlt. For create Bitmap you can use
CreateBitmapIndirect. But before this
you must learn any book
about Windows/Bitmaps/DIB and so on.(I recomend you
Petzold or Tom Swan books). In this boks there are many
examples of Display Bitmaps, make colors ...
Regards, Alex
0
 
psdavisCommented:
If you already have the array setup, then look at SetDIBitsToDevice and StretchDIBits.  

Quite a few examples on these two.

Phillip
0
 
TRMAuthor Commented:
i need more information on how to allow my program to use all of The screen. I want it to be the only posssible window on the screen, say, like C&C Red Alert. It takes up full screen. Do i need to change modes to allow read/write to that memory? "How do i get my program to run unwindowed full screen" is basicly what i'm asking.
thanks for the time
ty
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
TRMAuthor Commented:
i need more information on how to allow my program to use all of The screen. I want it to be the only posssible window on the screen, say, like C&C Red Alert. It takes up full screen. Do i need to change modes to allow read/write to that memory? "How do i get my program to run unwindowed full screen" is basicly what i'm asking.
thanks for the time
ty
0
 
AlexVirochovskyCommented:
For cretion you main Window, you must use
WS_POPUP style, as in example:

int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
                    PSTR szCmdLine, int iCmdShow)
     {
     static char szAppName[] = "HelloWin" ;
     HWND        hwnd ;
     MSG         msg ;
     WNDCLASS  wndclass ;

     wndclass.style         = CS_HREDRAW | CS_VREDRAW ;
     wndclass.lpfnWndProc   = WndProc ;
     wndclass.cbClsExtra    = 0 ;
     wndclass.cbWndExtra    = 0 ;
     wndclass.hInstance     = hInstance ;
     wndclass.hIcon         = LoadIcon (NULL, IDI_APPLICATION) ;
     wndclass.hCursor       = LoadCursor (NULL, IDC_ARROW) ;
     wndclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH) ;
     wndclass.lpszMenuName  = NULL ;
     wndclass.lpszClassName = szAppName ;

     RegisterClass (&wndclass) ;

     hwnd = CreateWindow (szAppName,// window class name
                "Hello Program",     // window caption
                WS_POPUP,     // window style
                0,           // initial x position
                0,           // initial y position
                640,           // initial x size
                480,           // initial y size
                NULL,
                NULL,
                hInstance,
                NULL) ;

     ShowWindow (hwnd, iCmdShow) ;
     UpdateWindow (hwnd) ;

     while (GetMessage (&msg, NULL, 0, 0))
          {
          TranslateMessage (&msg) ;
          DispatchMessage (&msg) ;
          }
     return msg.wParam ;
     }
After that you can display you text/Bitmap/Lines ... for
full screen.
Regards, Alex


0
 
TRMAuthor Commented:
Wow. That's Alot. Exactly what i was lookin for. Thanks, hope the points help. <g> ;)
Ty R. M.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now