Results 1 to 10 of 30

Thread: height field to sphere?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Administrator waldronate's Avatar
    Join Date
    Mar 2007
    Location
    The High Desert
    Posts
    3,562

    Default

    The best way to keep dialogs on top of the main window is to make the main window the parent window of the dialog. That way there won't be any confusion about Z ordering (child windows are on top of the parent and, if modeless, can swap Z order back and forth as the user clicks on them).

    http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx is an excellent discussion on dialog boxes in Windows, including building dialog templates directly in memory without having to use a resource compiler (.rc) file.
    Last edited by waldronate; 06-17-2012 at 02:26 AM.

  2. #2

    Default

    Quote Originally Posted by waldronate View Post
    The best way to keep dialogs on top of the main window is to make the main window the parent window of the dialog.
    done. past the trauma of first app with dialogs (and learned what topmost means explicitly!)

    added the updated app in itw thread, and now it's time for me to dig into procedural territory (ha).


    ..question (...)

    obviously using a hacked bitblt code to display, (which i presume means to everyone that i'm using a pointer to write to the image array) and i've noticed that my RGB has to be written BGR... i was quite puzzled when my water was orange..

    is this correct, or am i, as i suspect, writing one byte off? i'm sure i'll be able to adjust this when i've added the routine to export the fullsize bitmap and examine the top left and bottom right pixels...




    as said, copied from someone who has a deeper understanding of what they were doing..

    void deinit_framebuf(void) {
    SelectObject(pDC,old);
    DeleteDC(pDC);
    DeleteObject(framebmp);
    }

    void init_framebuf(void) {
    HDC hdc;
    BITMAPINFO bitmapinfo;
    hdc = CreateCompatibleDC(NULL);
    bitmapinfo.bmiHeader.biSize=sizeof(BITMAPINFOHEADE R);
    bitmapinfo.bmiHeader.biWidth=1024;
    bitmapinfo.bmiHeader.biHeight=-512;
    bitmapinfo.bmiHeader.biPlanes=1;
    bitmapinfo.bmiHeader.biBitCount=32;
    bitmapinfo.bmiHeader.biCompression=BI_RGB;
    bitmapinfo.bmiHeader.biSizeImage=0;
    bitmapinfo.bmiHeader.biClrUsed=256;
    bitmapinfo.bmiHeader.biClrImportant=256;
    framebmp = CreateDIBSection(hdc, &bitmapinfo, DIB_RGB_COLORS, (void**)&framebuf, 0, 0);
    pDC = CreateCompatibleDC(NULL);
    old = (HBITMAP)SelectObject(pDC, framebmp);
    DeleteDC(hdc);
    }



    for (y = 0; y < 512; y++) {
    z = y << 10;
    for (x = 0; x < 1024; x++) {
    *(framebuf + z + x) = RGB(blah);
    } }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •