Solved

Graphics in Windows

Posted on 1998-11-21
6
226 Views
Last Modified: 2010-04-01
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
Comment
Question by:TRM
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 1178410
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
 
LVL 7

Expert Comment

by:psdavis
ID: 1178411
If you already have the array setup, then look at SetDIBitsToDevice and StretchDIBits.  

Quite a few examples on these two.

Phillip
0
 

Author Comment

by:TRM
ID: 1178412
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
Independent Software Vendors: 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!

 

Author Comment

by:TRM
ID: 1178413
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
 
LVL 14

Accepted Solution

by:
AlexVirochovsky earned 250 total points
ID: 1178414
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
 

Author Comment

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

Featured Post

Industry Leaders: 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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question