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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Deinterlace Video 1

Status
Not open for further replies.

middelbh

Technical User
Feb 19, 2003
4
NL
Just as a tip for all Video/ Visual Basic enthousiasts: I found a VERY simple way to deinterlace video:
In fact its simple: stretchblt the interlaced picture into two pictures half the height, where stretchbltmode is 3!

Private Sub DeInterlace(picSRC, picDSTEven, picDSTOdd)

SetStretchBltMode picDSTEven.hdc, 3
SetStretchBltMode picDSTOdd.hdc, 3
picDSTEven.ScaleHeight = picSRC.ScaleHeight / 2
picDSTOdd.ScaleHeight = picSRC.ScaleHeight / 2
StretchBlt picDSTEven.hdc, 0, 0, picDSTEven.ScaleWidth, picDSTEven.ScaleHeight, picSRC.hdc, 0, 0, picSRC.ScaleWidth, picSRC.ScaleHeight - 1, &HCC0020
StretchBlt picDSTOdd.hdc, 0, 0, picDSTOdd.ScaleWidth, picDSTOdd.ScaleHeight, picSRC.hdc, 0, 1, picSRC.ScaleWidth, picSRC.ScaleHeight - 1, &HCC0020
picDSTEven.Refresh
picDSTOdd.Refresh
SetStretchBltMode picDSTEven.hdc, 1
SetStretchBltMode picDSTOdd.hdc, 1
End Sub


The opposite, so reinterlace, is even simpler than that. If you are interested, please let me know, I will then also put this on tek-tips!

Hope this helps anyone!

Hans
 
3 is better known as COLORONCOLOR mode (also as STRETCH_DELETESCANS)

There is further discussion about what can be achieved with SetStretchBltMode in thread222-539638
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top