Results 1 to 6 of 6

Thread: [RESOLVED] GetDIBits Crash Issue

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2013
    Posts
    190

    Resolved [RESOLVED] GetDIBits Crash Issue

    VB6
    Windows 7

    Okay, so I downloaded this code from http://www.tannerhelland.com/45/image-contrast-vb6/ to change the contrast of an image in real time. The problem comes when I change the image to something else, say http://i.imgur.com/m2yRhVv.png . When I changed the image of one PictureBox, I made sure to change the width/height of the other PictureBox, as the code requests. I've run the code in both the original project and copied the code into a new project of my own and I get the same results: it works with the provided picture but not with the one I've linked to on Imgur. Any help would be greatly appreciated.

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: GetDIBits Crash Issue

    Tanner is a regular here so you are probably in luck. For the rest of us, far too little information is provided. Generally crashes occur because the size of the buffer you are writing to is too small or the one you are reading from, you've read past its size. Possible you didn't account for scanlines on DWord boundaries?
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Sep 2013
    Posts
    190

    Re: GetDIBits Crash Issue

    I see. Thing is, I can't narrow down where the crash is happening simply because the image changes. If I could find where the buffer is, I could change it..... that is, if I knew how.

  4. #4
    Fanatic Member
    Join Date
    Aug 2013
    Posts
    806

    Re: GetDIBits Crash Issue

    @Conroy: if you'd waited a little longer, I could have handled all this via the email you sent me, instead of bothering poor vbForums users with my old, buggy code.

    LaVolpe's psychic powers are strong, and it was indeed a DWord problem. I've uploaded new .zip files that correct the issue.

    If you have any other questions about the code samples at my site (which are 15 years old at this point, and probably need to be revisited) feel free to contact me directly. I'll reply as quickly as I can.
    Check out PhotoDemon, a pro-grade photo editor written completely in VB6. (Full source available at GitHub.)

  5. #5
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: GetDIBits Crash Issue

    Quote Originally Posted by Tanner_H View Post
    LaVolpe's psychic powers are strong, and it was indeed a DWord problem. I've uploaded new .zip files that correct the issue.
    No special powers, just lots of similar experiences
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Sep 2013
    Posts
    190

    Re: GetDIBits Crash Issue

    Thanks guys. Tanner, after I wrote the e-mail I assumed that the page was super old and you might not even have the same e-mail address or even administered that site any longer, hence my post here.

Tags for this Thread

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