Results 1 to 24 of 24

Thread: [NOT RESOLVED YET] Can anyone please explain SetDIBits/SetDIBitsToDevice?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2004
    Posts
    72

    Question [NOT RESOLVED YET] Can anyone please explain SetDIBits/SetDIBitsToDevice?

    I've searched the whole internet and all i find is advanced functions which i can't break down to understand.

    May i please ask anyone to give a brief explanation, and a most BASIC use.
    (the 'target use' i am trying to achieve is to use it like SetPixel, 'OR' to change an image rgb)
    I hear these API calls are much much faster.

    Cheers ~
    Last edited by Drazzakia; Aug 14th, 2005 at 08:32 PM.
    Drazzakia... Knowlage is fresh with new data, mine is mastered with the old data. (i'm not talking about vb knowlage )

  2. #2
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Can anyone please explain SetDIBits/SetDIBitsToDevice?

    Google is even better at Allapi.net!

    http://www.mentalis.org/apilist/GetDeviceCaps.shtml


    It took a little while, but I found it!

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 2004
    Posts
    72

    Question Re: Can anyone please explain SetDIBits/SetDIBitsToDevice?

    Quote Originally Posted by dglienna
    Google is even better at Allapi.net!

    http://www.mentalis.org/apilist/GetDeviceCaps.shtml


    It took a little while, but I found it!

    Thank you but allapi.net was one of the first site i checked, and it didn't help :S
    Drazzakia... Knowlage is fresh with new data, mine is mastered with the old data. (i'm not talking about vb knowlage )

  4. #4
    Elite Hacker Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,349

    Re: Can anyone please explain SetDIBits/SetDIBitsToDevice?

    Try this program I wrote. It's even faster than SetDIBits. It's called Direct Memory Addressing. Very advanced yet very fast pixel writing. It uses DirectX:

    http://www.planet-source-code.com/vb...55262&lngWId=1

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Aug 2004
    Posts
    72

    Thumbs down Re: Can anyone please explain SetDIBits/SetDIBitsToDevice?

    Quote Originally Posted by Jacob Roman
    Try this program I wrote. It's even faster than SetDIBits. It's called Direct Memory Addressing. Very advanced yet very fast pixel writing. It uses DirectX:

    http://www.planet-source-code.com/vb...55262&lngWId=1
    I don't have the directx sdk installed
    Thanks but doesn't help.
    Drazzakia... Knowlage is fresh with new data, mine is mastered with the old data. (i'm not talking about vb knowlage )

  6. #6
    Elite Hacker Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,349

    Re: Can anyone please explain SetDIBits/SetDIBitsToDevice?

    You don't need any SDK.

    Odds are DirectX came with your OS or you installed a game that had it.

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Aug 2004
    Posts
    72

    Thumbs down Re: Can anyone please explain SetDIBits/SetDIBitsToDevice?

    It still doesn't help.
    All i wanted was some one to explain SetDIBitsToDevice

    Besides your '300k' app doesn't work when i compile it
    Drazzakia... Knowlage is fresh with new data, mine is mastered with the old data. (i'm not talking about vb knowlage )

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Aug 2004
    Posts
    72

    Re: Can anyone please explain SetDIBits/SetDIBitsToDevice?

    Actually the fast scanlines engine works, the others don't.

    OBJECT DOESN'T SUPPORT THIS ACTION:
    Direct_Draw.SetDisplayMode Width, Height, Color_Bit, 0, DDSDM_DEFAULT


    Not that i'm interested in using dir.x in my non game programs
    Drazzakia... Knowlage is fresh with new data, mine is mastered with the old data. (i'm not talking about vb knowlage )

  9. #9
    Elite Hacker Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,349

    Re: Can anyone please explain SetDIBits/SetDIBitsToDevice?

    You don't have the screen resolution then in your video card. Change it to 640 for width and 480 for height. Now it shoud work

  10. #10

    Thread Starter
    Lively Member
    Join Date
    Aug 2004
    Posts
    72

    Re: Can anyone please explain SetDIBits/SetDIBitsToDevice?

    @ Jacob: At least i've learned something from this thread, although not what was intentded.

    ==================== BUMP =====================
    May i please ask anyone to give a brief explanation, and a most BASIC use of SetDIBitsToDevice.
    (the 'target use' i am trying to achieve is to use it like SetPixel, 'OR' to change an image rgb)

    Cheers ~
    Drazzakia... Knowlage is fresh with new data, mine is mastered with the old data. (i'm not talking about vb knowlage )

  11. #11
    Elite Hacker Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,349

    Re: Can anyone please explain SetDIBits/SetDIBitsToDevice?

    That Direct Memory Addressing stuff is nothing compared to what DirectX can really do.

  12. #12

    Thread Starter
    Lively Member
    Join Date
    Aug 2004
    Posts
    72

    Re: Can anyone please explain SetDIBits/SetDIBitsToDevice?

    @ Jacob: I know that its more powerfull :P, its just not suitable

    ==================== BUMP =====================
    Surly some one knows about SetDIBitsToDevice. There are many advanced programs out there which use it.
    Drazzakia... Knowlage is fresh with new data, mine is mastered with the old data. (i'm not talking about vb knowlage )

  13. #13
    Elite Hacker Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,349

    Re: Can anyone please explain SetDIBits/SetDIBitsToDevice?

    Like what do you mean? What are you trying to accomplish?

  14. #14
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Can anyone please explain SetDIBits/SetDIBitsToDevice?

    Found better info:
    The SetDIBitsToDevice function sets the pixels in the specified rectangle on the device that is associated with the destination device context using color data from a device-independent bitmap (DIB).
    http://www.mentalis.org/apilist/SetDIBitsToDevice.shtml

    There is an example on the page.

  15. #15
    Elite Hacker Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,349

    Re: Can anyone please explain SetDIBits/SetDIBitsToDevice?

    That's the problem. It is dependent on a bitmap in order to plot the pixels. It's best to blit the whole picture instantly using BitBlt, although DirectX is way faster and uses the videocard.

  16. #16

    Thread Starter
    Lively Member
    Join Date
    Aug 2004
    Posts
    72

    Thumbs down Re: Can anyone please explain SetDIBits/SetDIBitsToDevice?

    Thanks but i saw this DIB example before posting, its got 10 api calls, and its not well commented in the slightest, infact there is only one comment (the copyright stuff) lol
    Drazzakia... Knowlage is fresh with new data, mine is mastered with the old data. (i'm not talking about vb knowlage )

  17. #17
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Can anyone please explain SetDIBits/SetDIBitsToDevice?

    But, if you look up each API you will see different examples. Basically, you are moving a picture from one device to another. Like a camcorder's small screen to the tv screen, I would imagine. Then to a printer. A lot of things are automatic in VB. API is quicker, but more complicated.
    What do you want to do, exactly?

  18. #18
    Elite Hacker Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,349

    Re: Can anyone please explain SetDIBits/SetDIBitsToDevice?

    Yeah you never answered my question. We are wondering what exactly are you trying to accomplish?

  19. #19

    Thread Starter
    Lively Member
    Join Date
    Aug 2004
    Posts
    72

    Re: Can anyone please explain SetDIBits/SetDIBitsToDevice?

    Quote Originally Posted by Drazzakia
    I've searched the whole internet and all i find is advanced
    (the 'target use' i am trying to achieve is to use it like SetPixel, 'OR' to change an image rgb)
    I hear these API calls are much much faster.
    Cheers ~
    I'm trying to achive: some one to explain the methods of SetDIBits/SetDIBitsToDevice
    Drazzakia... Knowlage is fresh with new data, mine is mastered with the old data. (i'm not talking about vb knowlage )

  20. #20

    Thread Starter
    Lively Member
    Join Date
    Aug 2004
    Posts
    72

    Re: Can anyone please explain SetDIBits/SetDIBitsToDevice?

    lol, jacob we registered on the same month of the same year
    Drazzakia... Knowlage is fresh with new data, mine is mastered with the old data. (i'm not talking about vb knowlage )

  21. #21
    Elite Hacker Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,349

    Re: Can anyone please explain SetDIBits/SetDIBitsToDevice?

    SetDIBits does it by scanlines, while SetDIBitsToDevice does it by the pixel.

  22. #22

    Thread Starter
    Lively Member
    Join Date
    Aug 2004
    Posts
    72

    Arrow Re: Can anyone please explain SetDIBits/SetDIBitsToDevice?

    Ok, i'll explain better:

    I want to set vaules to an array and draw to some picturebox in one go, like a double buffer.

    I can't understand the way this api uses headers ect. - and how to use them
    Drazzakia... Knowlage is fresh with new data, mine is mastered with the old data. (i'm not talking about vb knowlage )

  23. #23
    Elite Hacker Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,349

    Re: Can anyone please explain SetDIBits/SetDIBitsToDevice?

    That's what the BitBlt API and DirectX is for

    Does it in one go, while the SetDIBit API's needs many gos.

  24. #24

    Thread Starter
    Lively Member
    Join Date
    Aug 2004
    Posts
    72

    Re: Can anyone please explain SetDIBits/SetDIBitsToDevice?

    VB Code:
    1. 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 Integer

    You can use an array of pixels aswell as a DC for hSrcDC?
    Please show me how.

    This could be the very fast replacment for setpixel i'm looking for (other than dir.x)
    Drazzakia... Knowlage is fresh with new data, mine is mastered with the old data. (i'm not talking about vb knowlage )

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