Results 1 to 7 of 7

Thread: Paint Event ???

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Nitro
    Posts
    633
    I loaded about a hundred image which means I have a hundred image controls. Everytime I switch application and switch back to the form with these hundred image control, it seems like it is going through repainting or reloading again.


    Anyone knows how to prevent this, because I end up have to wait another 15 seconds.

    Thanks

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    You have 100 of imagecontrols? That's make me sick and your computer too. I would use the Bitblt API to draw all your images on the form. Load each file into one single picture and then use Bitblt to draw them on the form. Heres the Declarations:

    Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long

    Here's how to use it:

    BitBlt Me.hDC, posx, posy, pic.scalewidth, pic.scaleheight, pic.hdc, 0, 0, vbSrcCopy

    You can experiment with the values, set posx and posy to specify were the picture goes.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Nitro
    Posts
    633
    Well, when you don't know any other way, you have to find substitution.

    Anyway, thanks for your tip.

    You see, I am creating a employee browser. If I do it like your way, I am going have to find someother way to drap and drop.

    Anyway, Thanks.

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    It's hard but all hard programmers can do that. At least I have done much without any controls at all. Sorry, I need to know more about this drag & drop purpose if you want me to help you with that.

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Nitro
    Posts
    633
    Thanks!

    I am trying to make a directory image browser similar to the Paint Shop Pro. It has a drag and drop feature to categorize the images.

    Thanks for your input.

  6. #6
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    If you are not dragging and dropping them to other apps, It may be easy to just have one image control, that gets visible, when you start dragging, and invisible when you drop it. Easy thing with those mousemove events. And when the move is done, you can run a refreshing method that updates all with Bitblt. Let me know if you have more problems with that.

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Nitro
    Posts
    633
    Kedaman!

    Thanks for the info. I do need help on something else. Can you check the posting for "Bitblt?????"


    Thanks!

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