Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

For Loop? 1

Status
Not open for further replies.

snt

MIS
Jun 19, 2000
104
0
0
US
I have a function call 'Call frmMain.DTAFGMON1.Aqcuiremem(0,1,Singleshot).'
Basically this is a control to get a single frame from a frame grabber. The 0 is which window to display, and the 1 is how many frames to acquire.

I need to have this loop. I need to tell it to send frame1 to windwow1, frame2 to window2, frame3 to window3, and frame4 to window4. I then need it to go and start at 1 again in a loop until it is stopped, probably by a button.

I do not know much about programming, so any help is greatly appreciated.

BTW, I do not have the source for the control, and I can not get it.

-SNT
 
The error was my fault. Fixed and working. Star was given.
Now Step 2 :)

I need to rotate frame 2 90d, frame 3 180d, and frame 4 -90d.

Easy?

-SNT
 
Just to updae the rotation.

I have the formula to do this.

Would this be a simple -
Code:
IF i=2 then "formula"

Would this rotate the image?

-SNT
 
I doubt it but it depends on "formula"

Does it include some way to tell it where the image you want to rotate is?

It's probably included in that control somewhere but you probably have to do it to one of the buffers its captured.

Then you're back to needing another of its formulas to display the captured, rotated buffer on the form.
 
It would not be a simple rotation since the frame is not a square. The ratio needs to be the same. Basically, the frame would need to "coverted" into coordinates, then the coordinats need to be re-assigned, ex x2=y1. Then "coverted" back to the frame, then displayed.

-SNT
 
Start with the control documentation.
It may just be a frame grabber, in which case, read on, but do see if you can find any rotation methods there.

If not, rotation by 90 degree increments is pretty simple, and has been covered 72 gazillion times in this forum.
(search the FAQs)

in general terms, 90 degree rotation can be achieved by:

create a bitmap as wide as the source is high, and as high as the source is wide.

then (pseudocode)

for x = 0 to source.width
for y = 0 to source.height

target.pixel (y,x) = source.pixel(x,y)

next
next


 
Ok,

Will give it a shot Monday mornming and report back.

Thanks.

-SNT
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top