Thread: offscreen grafics port?

  1. #1
    Unregisterred
    Guest

    offscreen grafics port?

    Hi,
    I'm new to windows programming(used to do mac before) and I've got a drawing question. On mac one could draw into an offscreen graphicsport and then copy it into the window using various masking options. This was much faster than drawing directly into the window and it was very functional for some purposes. Is there a similar thing under win32?

    thx
    /Unregistered

  2. #2
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    your probably talking about a memory dc

    CreateCompatableDC()
    CreateCompatableBitmap()
    SelectObject()

    look into those. I hope you know what an HDC is. if not, say so
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  3. #3
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Are you talking about double buffering?....write to an offscreen buffer and then flip to the screen?

    WINAPI has OpenGL extensions that allow you to do this....SwapBuffers() (but there's a lot more work than just calling this API ).. and Direct X of course also has this capability

    Have a peek at NEHE

  4. #4
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    it seems he's talking memory DCs though. he mentioned masking operations and such, SRC_AND etc... "speed" I assume means anti-flicker or something. this is a double buffer using the GDI. Although if he really is after speed, go with OpenGL like fordy says. (that is available for mac though) Then again I don't know what he wants. ignore me now.
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  5. #5
    Unregisterred
    Guest
    uhmm..let me be a more precise:
    I want to be able to use drawing operations into an offscreen DC and then copy it to the windows DC...
    like:
    Draw a circle into offscreen DC
    copy this circle into the onscreen DC,masking it with a region in conjunktion with SRC_OR,SRC_AND etc...
    using this techinque will able me to copy 'parts' of the offscreen DC, like if I have a cirkle and a rectangle in a memory DC and a region masking the rectangle, I could mask it to copy only the rectangle into the onscreen DC.
    so a function something like:

    CopyFunc(Source DC, Destination DC, RegionMask, MaskFlags);

    is there like such a function in win32?

    thanks a bunch
    /Unregistered

  6. #6
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    yup! I was right.

    CreateCompatibleDC()
    CreateCompatableBitmap()
    SelectObject()
    BitBlt() <-That's the function you're talking about.

    look into all of these and you'll have everything you need.
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. FTP program
    By jakemott in forum Linux Programming
    Replies: 14
    Last Post: 10-06-2008, 01:58 PM
  2. brace-enclosed error
    By jdc18 in forum C++ Programming
    Replies: 53
    Last Post: 05-03-2007, 05:49 PM
  3. Segmentation Fault - Trying to access parallel port
    By tvsinesperanto in forum C Programming
    Replies: 3
    Last Post: 05-24-2006, 03:28 AM
  4. Basic port scanner code .. pls help ???
    By intruder in forum C Programming
    Replies: 18
    Last Post: 03-13-2003, 08:47 AM
  5. DOS, Serial, and Touch Screen
    By jon_nc17 in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 01-08-2003, 04:59 PM