Results 1 to 5 of 5

Thread: Edit Image In Memory

  1. #1

    Thread Starter
    Addicted Member slashandburn's Avatar
    Join Date
    Aug 1999
    Location
    Marietta, Ga
    Posts
    229

    Edit Image In Memory

    Im making a small app that assembles images, and the only function i need to add is a pixel check (To see if 1 pixel is like another)(For Transparency). If i use a picture box control it slows down only checking 5 - 8 per second, because it updates them. How could i check the pixels faster?

  2. #2
    Addicted Member
    Join Date
    Aug 2000
    Location
    Croatia
    Posts
    200
    If you use VBs PSet and Point methods, use API instead (GetPixel, SetPixelV). This will speed up the things a bit. Also, set the AutoRedraw of the picture box to True, hide the picture box, update the image and then show it.

  3. #3
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Also make sure you're not doing anything stupid in your loops.
    Optimize the loops as much as possible. eg. Use the Long data type as the counter.
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  4. #4
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    ma,usa
    Posts
    485
    using copymemoryAPI to read the picture in might make the operations go quicker too

  5. #5
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Copymemory will duplicate, to random access the memory you need to cheat vb using an array pointer to point to the memory location instead.

    check out Unlimited realities for tutorials on how to do this:
    http://www.ur.co.nz/
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

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