Solved

Graphics in Windows

Posted on 1998-11-21
6
231 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
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!

 

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

691 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