|
-
Dec 27th, 1999, 09:03 AM
#1
Thread Starter
New Member
I am doing a project in Image processing using Visual basic. Inorder to display an image, I am taking the position and color of each pixel and displaying it using Pset function.
Since the number of pixels that are to be plotted is very large, say 512x512, it takes a lotof time. I would like to know, how it is possible to speed up the process.
In C, we could write directlyto the video memory. How is this possible in Visual basic. Is any other method available ?
[Note : I cannot use the putimage function as each pixel has to be processed ]
-
Dec 27th, 1999, 09:44 PM
#2
Try looking for big areas of color and filling them in with this statement:
LINE (X1, Y1)-(X2, Y2), C, BF
where X1 and Y1 are the upper-left coords, X2 and Y2 are the lower-right coords, and C is the color.
I'm not sure if this will work with what you are writing. What is it anyway?
-
Dec 28th, 1999, 09:36 AM
#3
Thread Starter
New Member
Thanks so much for your reply, sparkle. But I cannot use the Line function since I have to plot the color values of each pixel individually to increase the clarity of the image. This obviously takes a lot of time. So I figured if there was a way of writing the pixel values to video memory, then the whole process would be completed in a jiffy. Can anybody help ?
-
Dec 30th, 1999, 07:35 AM
#4
New Member
I realise this won't be direcly helpful, but it might nudge either you or someone else in the right direction:
I don't think VB allows you to access memory directly, HOWEVER, I'm pretty sure I noticed that DirectX does (as an array, I think), so you could potentially use the DX7 object to do what you want to do...
Hope this isn't to unhelpful...
------------------
Mike
Software Developer
-
Jan 3rd, 2000, 07:49 PM
#5
Hyperactive Member
-
Jan 6th, 2000, 04:30 PM
#6
Lively Member
manoj
i also made a project similar to what you are trying to do and encountered the same speed problem. first i take the color of a certain point in the source image with the Point function and draws it with the PSet function. what i did was made two or more lines of these to double the copying and painting process. sorry i forgot the correct syntax for the functions but here's a hint...
try comparing what finishes faster:
For i = 1 to 100000
Debug.Print i
Next i
-or-
For i = 1 to 100000 Step 4
Debug.Print i
Debug.Print i + 1
Debug.Print i + 2
Debug.Print i + 3
Next i
the second code is 4 times faster than the first one since it prints four times in one pass.
hope it helps! goodluck with your project.
-
Jan 6th, 2000, 06:28 PM
#7
Hyperactive Member
hmmm yeah that makes sense actaully. so games will draw as much as they can each loop, to speed it up? ill keep it in mind for DX7 (making a real time strategy)
------------------
cintel rules 
www.cintelsoftware.co.uk
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
|