Results 1 to 3 of 3

Thread: bitblt and memory DC

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2002
    Posts
    159

    Question bitblt and memory DC

    Hi all,

    I posted this thread to the API forum but didn't get any response so I thought it might be a good idea to repost it here.
    Currently I'm working on a program that makes an extensive use of bitblt Api function to copy images from one picture box to another.

    My questions are:
    1. Will the copying be significantly faster if I'll use memory DC for storing the source picture? (by using CreatCompaibleDC and LoadImage Api functions), and
    2. I would like to hide the picture files from the user, so is there a way to load the pictures to the memory DC from a picture box rather then in a file?
    Any help or a piece of code will be greatly appreciated.

  2. #2
    Hyperactive Member toughcoder's Avatar
    Join Date
    Nov 2002
    Location
    Near, Very Near
    Posts
    340
    hi bach,
    well the loadImage+Create.... will significantly boost performance but it must be used with care. U must consider ur client specifications also. If any1 using a 32 MB ram sys gets using loadimage, chances r the function will return a -ve value(a failed function) and the image doesnt load. This wil effect the app. So its better to use a pixBox.
    for ur second query, u can blit a pix from a pixBox to a DC. That will help not loading a pix from file.
    If Not VB Then Exit
    ------------------------------------------------
    visit me @ http://mzubair.50g.com/

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Aug 2002
    Posts
    159
    Hi toughcoder,
    After I posted this thread I made some tests to see how faster is bitbliting from a memory DC
    vs picture box. surprisingly, all tests showed that there are not any advantage to memory DC over
    picture box when speed is in concern. Apparently in both method the data is being read directly
    from memory. If you want I'll post the code I used for testing.
    As for the other one, I guess it can be worked out this way.
    Thanks allot!

Posting Permissions

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



Click Here to Expand Forum to Full Width