Extensions/ImageGlass.Feature/ImageGlass_ImageInfo.vb

(开头部分) 7KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。


Imports System.Runtime.InteropServices
Imports System.Drawing

Public Class ImageGlass_ImageInfo

    <StructLayout(LayoutKind.Sequential)> Private Structure SHELLEXECUTEINFO
        Public cbSize As Integer
        Public fMask As Integer
        Public hwnd As IntPtr
        Public lpVerb As String
        Public lpFile As String
        Public lpParameters As String
        Public lpDirectory As String
        Public nShow As Integer
        Public hInstApp As IntPtr
        Public lpIDList As IntPtr
        Public lpClass As String
        Public hkeyClass As IntPtr
        Public dwHotKey As Integer
        Public hIcon As IntPtr
        Public hProcess As IntPtr
    End Structure

    <DllImport("shell32.dll", EntryPoint:="ShellExecuteEx")> _
    Private Shared Function ShellExecute(ByRef s As SHELLEXECUTEINFO) As Integer
    End Function

    ''' <summary>
    ''' Hiển thị hộp thoại Properties của tập tin, thư mục
    ''' </summary>
    ''' <param name="FileName"></param>
    ''' <param name="hwnd"></param>
    ''' <remarks></remarks>
    Public Shared Sub DisplayFileProperties(ByVal FileName As String, ByVal hwnd As IntPtr)
        Const SEE_MASK_INVOKEIDLIST As Integer = &HC
        Const SW_SHOW As Integer = 5
        Dim shInfo As New SHELLEXECUTEINFO()
        With shInfo
            .cbSize = Marshal.SizeOf(shInfo)
            .lpFile = FileName
            .nShow = SW_SHOW
            .fMask = SEE_MASK_INVOKEIDLIST
            .lpVerb = "properties"
            .hwnd = hwnd
        End With
        ShellExecute(shInfo)
    End Sub

    ''' <summary>
    ''' Lấy tên loại định dạng của hình ảnh
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Shared Function GetImageFileType(ByVal filename As String) As String

        Dim ext As String = IO.Path.GetExtension(filename).Replace(".", "").ToLower()
        Select Case ext
            Case "bmp" : Return "Bitmap Image File"
            Case "dib" : Return "Device Independent Bitmap File"
后面还有 145 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。