缩放图片/视频并获取像素 [英] Zoom picture/video and get pixels

查看:178
本文介绍了缩放图片/视频并获取像素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在VB.NET中寻找具有以下选项的项目。让我们说我们有图片框和图片。当我点击图片进行缩放时,程序会计算缩放部分的像素。或者另一种选择是我有视频。有人能告诉我这种项目吗?



我尝试过:



I am looking for the project in VB.NET with the following options.Let's say we have picture box and picture in it. When i clicked on the picture to zoom it the program calculate pixels of the zoom part. Or the other option is when I have video. Can someone show me this kind of project?

What I have tried:

Dim fs As FileStream

OpenFileDialog1.Filter = "JPG files (*.jpg)|*.jpg|" & "BMP Files (*.bmp)|*.bmp|" _
    & "TIF Files (*.tif)|*.tif|" & "PNG Files (*.png)|*.png|" & "ALL Files (*.*)|*.*"
OpenFileDialog1.Title = "Select an Image File"
If OpenFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
    currentfilename = OpenFileDialog1.FileName
    If currentfilename.ToUpper.EndsWith(".JPG") Or _
    currentfilename.ToUpper.EndsWith(".BMP") Or _
    currentfilename.ToUpper.EndsWith(".TIF") Or _
    currentfilename.ToUpper.EndsWith(".PNG") Then
       If Not (Pic.Image Is Nothing) Then
             Pic.Image.Dispose()
             Pic.Image = Nothing
       End If
       fs = New FileStream(currentfilename, IO.FileMode.Open, IO.FileAccess.Read)
       Pic.Image = Image.FromStream(fs)
       original = Pic.Image
    End If
End If

推荐答案

这是一个项目使用 ffmpeg 库:带有Progres的FFMPEG视频转换器sbar VB.NET [ ^ ]

在这里您可以找到如何使用ffmpeg缩放命令: [ ^ ]



如果你想要一个WPF解决方案,你可以尝试WPF-MediaKit:GitHub - Sascha-L / WPF-MediaKit [ ^ ]

但是我找不到很多关于它的文档,除了这个:首页·Sascha-L / WPF-MediaKit Wiki·GitHub [ ^ ]



这是一个C#项目: EVR Presenter采用纯C#和Direct3D视频渲染 [ ^ ]
Here is a project using the ffmpeg library: FFMPEG Video Converter with Progressbar VB.NET[^]
Here you can find how to use the ffmpeg zoom commands: Zoom video using ffmpeg commands - Super User[^]

If you want a WPF solution, you can try WPF-MediaKit: GitHub - Sascha-L/WPF-MediaKit[^]
But I could not find much documentation about it, except this: Home · Sascha-L/WPF-MediaKit Wiki · GitHub[^]

Here is a C# project: EVR Presenter in pure C# with Direct3D Video Rendering[^]


这篇关于缩放图片/视频并获取像素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆