|
-
Nov 4th, 2002, 08:53 AM
#1
Thread Starter
Junior Member
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
-
Nov 4th, 2002, 03:05 PM
#2
Fanatic Member
I'm not sure but I think the PictureBox control is faster and more lightweight than the Image control.
-
Nov 4th, 2002, 03:09 PM
#3
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 ....
-
Nov 4th, 2002, 03:53 PM
#4
Good Ol' Platypus
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)
-
Nov 5th, 2002, 12:34 PM
#5
Addicted Member
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
-
Nov 7th, 2002, 11:28 AM
#6
Thread Starter
Junior Member
Ok, guys, thanks !
But does somebody already has a stretch routine (using API)already written to help me to develop faster this project ?
-
Nov 7th, 2002, 03:48 PM
#7
Addicted Member
this is the API function
PHP Code:
Private Declare Function StretchBlt Lib "gdi32" Alias "StretchBlt" (ByVal hdc 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 nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal 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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|