Results 1 to 7 of 7

Thread: Time Critical Image Loading..

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2002
    Posts
    31

    Time Critical Image Loading..

    Hi,
    I need to load a lot of pictures and to stretch them,
    I use the built-in "Image" control of VB6 :
    The problem is that i need to be as fast as possible, and i know that graphics are the weakness of VB

    Is there any other ways to load picture more quickly using a compiled DLL or a free ActiveX ??

    Thanks in advance for your replies

  2. #2
    Fanatic Member riis's Avatar
    Join Date
    Nov 2001
    Posts
    551
    I'm not sure but I think the PictureBox control is faster and more lightweight than the Image control.

  3. #3
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    I'm not sure either 'riis' but I think the exact opposite of you...



    But I think I'm a little bit more sure then you ....

  4. #4
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    The fastest way would be to open the bitmap, just accessing the bytes, and then load that into a bitmap object. Then you write your own stretching routine, create a new bitmap, put your stretched image in, and save it back to file...

    Or you could loadpicture it (both Image and Pictureboxes use the same routine, but the Image control is faster) with a Picturebox (the reason for picturebox is Imageboxes don't have device contexts, or their DCs are hidden), StretchBlt (faster than PaintPicture), and SavePicture the .Image. It wouldn't be too too slow to do it the SavePicture way, but doing it directly manipulating the bits would take mere milliseconds (plus the time to load/save).
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  5. #5
    Addicted Member
    Join Date
    Apr 2002
    Location
    Israel
    Posts
    152
    sastraxi is right that's the best way but it will take very long to write it just us a picture box and the followings:
    loadpicture
    strechblt (API)
    savepicture

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Oct 2002
    Posts
    31

    Ok, guys, thanks !

    But does somebody already has a stretch routine (using API)already written to help me to develop faster this project ?

  7. #7
    Addicted Member
    Join Date
    Apr 2002
    Location
    Israel
    Posts
    152
    this is the API function
    PHP Code:
    Private Declare Function StretchBlt Lib "gdi32" Alias "StretchBlt" (ByVal hdc As LongByVal x As LongByVal y As LongByVal nWidth As LongByVal nHeight As LongByVal hSrcDC As LongByVal xSrc As LongByVal ySrc As LongByVal nSrcWidth As LongByVal nSrcHeight As LongByVal dwRop As Long) As Long 

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