Solved

Graphics in Windows

Posted on 1998-11-21
6
188 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
  • 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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

760 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now