|
8515
|
Programación / .NET (C#, VB.NET, ASP) / Re: Necesito que alguien me compile un proyecto de C#
|
en: 20 Julio 2013, 11:31 am
|
Tu usas el mismo VS2012 que yo, creo... A mi si se me abren ya que se me compilen es otra cosa... Si usaste mi instalador con las opciones por defecto entonces vas a ser incapaz de abrir un proyecto donde se maneje C/C++ ya que hay que elegir esos paquetes manualmente en el instalador (si se quieren instalar), en cambio los proyectos CSharp puro si que puedes abrirlos y además compilarlos.
|
|
|
8517
|
Programación / .NET (C#, VB.NET, ASP) / Re: Librería de Snippets !! (Posteen aquí sus snippets)
|
en: 20 Julio 2013, 10:56 am
|
Una class de ayuda para manejar lo básico de la librería FreeImage Convertir entre formatos, convertir a escala de grises, rotar, redimensionar, generar un thumbnail... http://freeimage.sourceforge.net/download.html#Region " FreeImage Helper " ' [ FreeImage Helper ] ' ' // By Elektro H@cker ' ' ' INSTRUCTIONS: ' 1. ADD A REFERENCE FOR "FreeImageNET.dll" IN THE PROJECT. ' 2. ADD THE "FREEIMAGE.DLL" IN THE PROJECT. ' ' ' Examples : ' ' MsgBox(FreeImageHelper.Is_Avaliable() ' Result: True ' MsgBox(FreeImageHelper.Get_Version() ' Result: 3.15.1 ' MsgBox(FreeImageHelper.Get_ImageFormat("C:\Test.png")) ' Result: PNG ' ' FreeImageHelper.Convert("C:\Test.png", "C:\Test.ico", FreeImageAPI.FREE_IMAGE_FORMAT.FIF_ICO) ' FreeImageHelper.Convert(New Bitmap("C:\Test.png"), "C:\Test.jpg", FreeImageAPI.FREE_IMAGE_FORMAT.FIF_JPEG, FreeImageAPI.FREE_IMAGE_SAVE_FLAGS.JPEG_SUBSAMPLING_444 Or FreeImageAPI.FREE_IMAGE_SAVE_FLAGS.JPEG_QUALITYSUPERB) ' ' PictureBox1.BackgroundImage = FreeImageHelper.GrayScale(New Bitmap("C:\Test.bmp")) ' PictureBox1.BackgroundImage = FreeImageHelper.GrayScale("C:\Test.bmp") ' ' PictureBox1.BackgroundImage = FreeImageHelper.Resize(New Bitmap("C:\Test.bmp"), 32, 32) ' PictureBox1.BackgroundImage = FreeImageHelper.Resize("C:\Test.bmp", 64, 128) ' ' PictureBox1.BackgroundImage = FreeImageHelper.Rotate(New Bitmap("C:\Test.bmp"), 90) ' PictureBox1.BackgroundImage = FreeImageHelper.Rotate("C:\Test.bmp", -90) ' ' PictureBox1.BackgroundImage = FreeImageHelper.Thumbnail(New Bitmap("C:\Test.png"), 64, True) ' PictureBox1.BackgroundImage = FreeImageHelper.Thumbnail("C:\Test.png", 64, True) Imports FreeImageAPI Public Class FreeImageHelper ' <summary> ' Checks if <i>FreeImage.dll</i> is avaliable on the system. ' </summary> Public Shared Function Is_Avaliable() As Boolean Return FreeImage.IsAvailable End Function ' <summary> ' Gets the version of FreeImage.dll. ' </summary> Shared Function Get_Version() As String Return FreeImage.GetVersion End Function ' <summary> ' Gets the image format of a image file. ' </summary> Shared Function Get_ImageFormat (ByVal File As String) As String Return FreeImage. GetFileType(File, 0). ToString. Substring(4) End Function ' <summary> ' Convert a Bitmap object between image formats and save it to disk. ' </summary> Shared Sub Convert(ByVal bmp As System.Drawing.Bitmap, _ ByVal Output As String, _ ByVal NewFormat As FREE_IMAGE_FORMAT, _ Optional ByVal SaveFlags As FREE_IMAGE_SAVE_FLAGS = FREE_IMAGE_SAVE_FLAGS.DEFAULT) Try FreeImage.SaveBitmap(bmp, Output, NewFormat, SaveFlags) Catch ex As Exception ' Throw New Exception(ex.Message) MsgBox(ex.Message) End Try End Sub ' <summary> ' Convert a image file between image formats and save it to disk. ' </summary> Shared Sub Convert (ByVal File As String, _ ByVal Output As String, _ ByVal NewFormat As FREE_IMAGE_FORMAT, _ Optional ByVal SaveFlags As FREE_IMAGE_SAVE_FLAGS = FREE_IMAGE_SAVE_FLAGS.DEFAULT) Try FreeImage. Save(NewFormat, FreeImage. LoadEx(File), Output, SaveFlags ) Catch ex As Exception ' Throw New Exception(ex.Message) MsgBox(ex.Message) End Try End Sub ' <summary> ' GrayScales a Bitmap object. ' </summary> Shared Function GrayScale(ByVal bmp As System.Drawing.Bitmap) As System.Drawing.Bitmap Try Dim ImageStream As New System.IO.MemoryStream bmp.Save(ImageStream, bmp.RawFormat) Dim Image As FIBITMAP = FreeImage.LoadFromStream(ImageStream) ImageStream.Dispose() Return FreeImage.GetBitmap(FreeImage.ConvertToGreyscale(Image)) Catch ex As Exception ' Throw New Exception(ex.Message) MsgBox(ex.Message) Return Nothing End Try End Function ' <summary> ' GrayScales a image file. ' </summary> Shared Function GrayScale (ByVal File As String) As System. Drawing. Bitmap Try Return FreeImage. GetBitmap(FreeImage. ConvertToGreyscale(FreeImage. LoadEx(File))) Catch ex As Exception ' Throw New Exception(ex.Message) MsgBox(ex.Message) Return Nothing End Try End Function ' <summary> ' Resizes a Bitmap object. ' </summary> Shared Function Resize(ByVal bmp As System.Drawing.Bitmap, _ ByVal X As Int32, _ ByVal Y As Int32, _ Optional ByVal Quality As FREE_IMAGE_FILTER = FREE_IMAGE_FILTER.FILTER_BILINEAR) As System.Drawing.Bitmap Try Dim ImageStream As New System.IO.MemoryStream bmp.Save(ImageStream, bmp.RawFormat) Dim Image As FIBITMAP = FreeImage.LoadFromStream(ImageStream) ImageStream.Dispose() Return FreeImage.GetBitmap(FreeImage.Rescale(Image, X, Y, Quality)) Catch ex As Exception ' Throw New Exception(ex.Message) MsgBox(ex.Message) Return Nothing End Try End Function ' <summary> ' Resizes a image file. ' </summary> Shared Function Resize (ByVal File As String, _ ByVal X As Int32, _ ByVal Y As Int32, _ Optional ByVal Quality As FREE_IMAGE_FILTER = FREE_IMAGE_FILTER.FILTER_BILINEAR) As System.Drawing.Bitmap Try Return FreeImage. GetBitmap(FreeImage. Rescale(FreeImage. LoadEx(File), X, Y, Quality )) Catch ex As Exception ' Throw New Exception(ex.Message) MsgBox(ex.Message) Return Nothing End Try End Function ' <summary> ' Rotates a Bitmap object. ' </summary> Shared Function Rotate(ByVal bmp As System.Drawing.Bitmap, _ ByVal Angle As Double) As System.Drawing.Bitmap Try Dim ImageStream As New System.IO.MemoryStream bmp.Save(ImageStream, bmp.RawFormat) Dim Image As FIBITMAP = FreeImage.LoadFromStream(ImageStream) ImageStream.Dispose() Return FreeImage.GetBitmap(FreeImage.Rotate(Image, Angle)) Catch ex As Exception ' Throw New Exception(ex.Message) MsgBox(ex.Message) Return Nothing End Try End Function ' <summary> ' Rotates a image file. ' </summary> Shared Function Rotate (ByVal File As String, _ ByVal Angle As Double) As System.Drawing.Bitmap Try Return FreeImage. GetBitmap(FreeImage. Rotate(FreeImage. LoadEx(File), Angle )) Catch ex As Exception ' Throw New Exception(ex.Message) MsgBox(ex.Message) Return Nothing End Try End Function ' <summary> ' Returns a Thumbnail of a Bitmap object. ' </summary> Shared Function Thumbnail(ByVal bmp As System.Drawing.Bitmap, _ ByVal size As Int32, _ ByVal convert As Boolean) As System.Drawing.Bitmap Try Dim ImageStream As New System.IO.MemoryStream bmp.Save(ImageStream, bmp.RawFormat) Dim Image As FIBITMAP = FreeImage.LoadFromStream(ImageStream) ImageStream.Dispose() Return FreeImage.GetBitmap(FreeImage.MakeThumbnail(Image, size, convert)) Catch ex As Exception ' Throw New Exception(ex.Message) MsgBox(ex.Message) Return Nothing End Try End Function ' <summary> ' Returns a Thumbnail of a image file. ' </summary> Shared Function Thumbnail (ByVal File As String, _ ByVal size As Int32, _ ByVal convert As Boolean) As System.Drawing.Bitmap Try Return FreeImage. GetBitmap(FreeImage. MakeThumbnail(FreeImage. LoadEx(File), size, convert )) Catch ex As Exception ' Throw New Exception(ex.Message) MsgBox(ex.Message) Return Nothing End Try End Function End Class #End Region
Informa a Windows de cambios en el sistema para refrescar el sistema. #Region " System Notifier " ' [ System Notifier ] ' ' Examples : ' ' SystemNotifier.Notify(SystemNotifier.EventID.FileAssociation_Changed, SystemNotifier.NotifyFlags.DWORD, IntPtr.Zero, IntPtr.Zero) Public Class SystemNotifier <System.Runtime.InteropServices.DllImport("shell32.dll")> _ Shared Sub SHChangeNotify( _ ByVal wEventID As EventID, _ ByVal uFlags As NotifyFlags, _ ByVal dwItem1 As IntPtr, _ ByVal dwItem2 As IntPtr) End Sub Shared Sub Notify(ByVal wEventID As EventID, ByVal uFlags As NotifyFlags, ByVal dwItem1 As IntPtr, ByVal dwItem2 As IntPtr) SHChangeNotify(wEventID, uFlags, dwItem1, dwItem2) End Sub <Flags()> _ Public Enum NotifyFlags ' <summary> ' The <i>dwItem1</i> and <i>dwItem2</i> parameters are DWORD values. ' </summary> DWORD = &H3 ' <summary> ' <i>dwItem1</i> and <i>dwItem2</i> are the addresses of ItemIDList structures, ' that represent the item(s) affected by the change. ' Each ItemIDList must be relative to the desktop folder. ' </summary> ItemIDList = &H0 ' <summary> ' <i>dwItem1</i> and <i>dwItem2</i> are the addresses of null-terminated strings, ' of maximum length MAX_PATH that contain the full path names of the items affected by the change. ' </summary> PathA = &H1 ' <summary> ' <i>dwItem1</i> and <i>dwItem2</i> are the addresses of null-terminated strings, ' of maximum length MAX_PATH that contain the full path names of the items affected by the change. ' </summary> PathW = &H5 ' <summary> ' <i>dwItem1</i> and <i>dwItem2</i> are the addresses of null-terminated strings, ' that represent the friendly names of the printer(s) affected by the change. ' </summary> PrinterA = &H2 ' <summary> ' <i>dwItem1</i> and <i>dwItem2</i> are the addresses of null-terminated strings, ' that represent the friendly names of the printer(s) affected by the change. ' </summary> PrinterW = &H6 ' <summary> ' The function should not return until the notification has been delivered to all affected components. ' As this flag modifies other data-type flags it cannot by used by itself. ' </summary> Flush = &H1000 ' <summary> ' The function should begin delivering notifications to all affected components, ' but should return as soon as the notification process has begun. ' As this flag modifies other data-type flags it cannot by used by itself. ' </summary> FlushNoWait = &H2000 End Enum <Flags()> _ Public Enum EventID ' <summary> ' All events have occurred. ' </summary> All_Events = &H7FFFFFFF ' <summary> ' A folder has been created. ' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>. ' <i>dwItem1</i> contains the folder that was created. ' <i>dwItem2</i> is not used and should be <see langword="null"/>. ' </summary> Directory_Created = &H8 ' <summary> ' A folder has been removed. ' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>. ' <i>dwItem1</i> contains the folder that was removed. ' <i>dwItem2</i> is not used and should be <see langword="null"/>. ' </summary> Directory_Deleted = &H10 ' <summary> ' The name of a folder has changed. ' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>. ' <i>dwItem1</i> contains the previous pointer to an item identifier list (PIDL) or name of the folder. ' <i>dwItem2</i> contains the new PIDL or name of the folder. ' </summary> Directory_Renamed = &H20000 ' <summary> ' A nonfolder item has been created. ' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>. ' <i>dwItem1</i> contains the item that was created. ' <i>dwItem2</i> is not used and should be <see langword="null"/>. ' </summary> Item_Created = &H2 ' <summary> ' A nonfolder item has been deleted. ' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>. ' <i>dwItem1</i> contains the item that was deleted. ' <i>dwItem2</i> is not used and should be <see langword="null"/>. ' </summary> Item_Deleted = &H4 ' <summary> ' The name of a nonfolder item has changed. ' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>. ' <i>dwItem1</i> contains the previous PIDL or name of the item. ' <i>dwItem2</i> contains the new PIDL or name of the item. ' </summary> Item_Renamed = &H1 ' <summary> ' A drive has been added. ' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>. ' <i>dwItem1</i> contains the root of the drive that was added. ' <i>dwItem2</i> is not used and should be <see langword="null"/>. ' </summary> Drive_Added = &H100 ' <summary> ' A drive has been added and the Shell should create a new window for the drive. ' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>. ' <i>dwItem1</i> contains the root of the drive that was added. ' <i>dwItem2</i> is not used and should be <see langword="null"/>. ' </summary> Drive_Added_Shell = &H10000 ' <summary> ' A drive has been removed. <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>. ' <i>dwItem1</i> contains the root of the drive that was removed. ' <i>dwItem2</i> is not used and should be <see langword="null"/>. ' </summary> Drive_Removed = &H80 ' <summary> ' Storage media has been inserted into a drive. ' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>. ' <i>dwItem1</i> contains the root of the drive that contains the new media. ' <i>dwItem2</i> is not used and should be <see langword="null"/>. ' </summary> Media_Inserted = &H20 ' <summary> ' Storage media has been removed from a drive. ' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>. ' <i>dwItem1</i> contains the root of the drive from which the media was removed. ' <i>dwItem2</i> is not used and should be <see langword="null"/>. ' </summary> Media_Removed = &H40 ' <summary> ' A folder on the local computer is being shared via the network. ' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>. ' <i>dwItem1</i> contains the folder that is being shared. ' <i>dwItem2</i> is not used and should be <see langword="null"/>. ' </summary> Net_Shared = &H200 ' <summary> ' A folder on the local computer is no longer being shared via the network. ' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>. ' <i>dwItem1</i> contains the folder that is no longer being shared. ' <i>dwItem2</i> is not used and should be <see langword="null"/>. ' </summary> Net_Unshared = &H400 ' <summary> ' The computer has disconnected from a server. ' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>. ' <i>dwItem1</i> contains the server from which the computer was disconnected. ' <i>dwItem2</i> is not used and should be <see langword="null"/>. ' </summary> Server_Disconnected = &H4000 ' <summary> ' The attributes of an item or folder have changed. ' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>. ' <i>dwItem1</i> contains the item or folder that has changed. ' <i>dwItem2</i> is not used and should be <see langword="null"/>. ' </summary> Attributes_Changed = &H800 ' <summary> ' A file type association has changed. <see cref="NotifyFlags.ItemIDList"/> ' must be specified in the <i>uFlags</i> parameter. ' <i>dwItem1</i> and <i>dwItem2</i> are not used and must be <see langword="null"/>. ' </summary> FileAssociation_Changed = &H8000000 ' <summary> ' The amount of free space on a drive has changed. ' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>. ' <i>dwItem1</i> contains the root of the drive on which the free space changed. ' <i>dwItem2</i> is not used and should be <see langword="null"/>. ' </summary> Freespace_Changed = &H40000 ' <summary> ' The contents of an existing folder have changed but the folder still exists and has not been renamed. ' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>. ' <i>dwItem1</i> contains the folder that has changed. ' <i>dwItem2</i> is not used and should be <see langword="null"/>. ' If a folder has been created, deleted or renamed use Directory_Created, Directory_Removed or Directory_Renamed respectively instead. ' </summary> Update_Directory = &H1000 ' <summary> ' An image in the system image list has changed. ' <see cref="NotifyFlags.DWORD"/> must be specified in <i>uFlags</i>. ' </summary> Update_Image = &H8000 End Enum End Class #End Region
|
|
|
8518
|
Programación / .NET (C#, VB.NET, ASP) / Re: [AYUDA] VB.NET BUSCAR EN UN DIRECTORIO Y COMPARAR EL CHEKSUM MD5
|
en: 20 Julio 2013, 02:17 am
|
#Region " Get Files " ' [ Get Files Function ] ' ' // By Elektro H@cker ' ' Examples : ' ' For Each file In Get_Files("C:\Windows", False) : MsgBox(file.Name) : Next ' ' For Each file In Get_Files("C:\Windows", True, "dll") : MsgBox(file.Name) : Next ' For Each file In Get_Files("C:\Windows", True, ".dll") : MsgBox(file.Name) : Next ' For Each file In Get_Files("C:\Windows", True, "*.dll") : MsgBox(file.Name) : Next ' ' For Each file In Get_Files("C:\Windows", False, {"dll", "ini"}) : MsgBox(file.Name) : Next ' For Each file In Get_Files("C:\Windows", False, {".dll", ".ini"}) : MsgBox(file.Name) : Next ' For Each file In Get_Files("C:\Windows", False, {"*.dll", "*.ini"}) : MsgBox(file.Name) : Next ' Get Files {directory} {recursive} Private Function Get_Files(ByVal directory As String, ByVal recursive As Boolean) As List(Of IO.FileInfo) Dim searchOpt As IO.SearchOption = If(recursive, IO.SearchOption.AllDirectories, IO.SearchOption.TopDirectoryOnly) Return IO.Directory.GetFiles(directory, "*", searchOpt).Select(Function(p) New IO.FileInfo(p)).ToList End Function ' Get Files {directory} {recursive} {ext} Private Function Get_Files(ByVal directory As String, ByVal recursive As Boolean, ext As String) As List(Of IO.FileInfo) If ext.StartsWith("*") Then ext = ext.Substring(1, ext.Length - 1) ElseIf Not ext = "*" AndAlso Not ext.StartsWith(".") Then ext = ("." & ext) ElseIf ext = "*" Then ext = Nothing End If Dim searchOpt As IO.SearchOption = If(recursive, IO.SearchOption.AllDirectories, IO.SearchOption.TopDirectoryOnly) Return IO.Directory.GetFiles(directory, "*" & ext, searchOpt).Select(Function(p) New IO.FileInfo(p)).ToList End Function ' Get Files {directory} {recursive} {exts()} Private Function Get_Files(ByVal directory As String, ByVal recursive As Boolean, ParamArray exts() As String) As List(Of IO.FileInfo) Dim FileExts(exts.Count) As String Dim ExtCount As Int32 = 0 For Each ext In exts If ext.StartsWith("*") Then FileExts(ExtCount) = ext.Substring(1, ext.Length - 1) ElseIf Not ext = "*" AndAlso Not ext.StartsWith(".") Then FileExts(ExtCount) = ("." & ext) ElseIf Not ext = "*" AndAlso ext.StartsWith(".") Then FileExts(ExtCount) = ext ElseIf ext = "*" Then FileExts(ExtCount) = Nothing End If ExtCount += 1 Next Dim searchOpt As IO.SearchOption = If(recursive, IO.SearchOption.AllDirectories, IO.SearchOption.TopDirectoryOnly) Dim filenameExtComparer As New FilenameExtensionComparer Return IO.Directory.GetFiles(directory, "*", searchOpt).Where(Function(o) FileExts.Contains(IO.Path.GetExtension(o), filenameExtComparer)).Select(Function(p) New IO.FileInfo(p)).ToList End Function ' FilenameExtensionComparer (Ignore Case) needed for "Get Files {directory} {recursive} {exts()}" overload. Public Class FilenameExtensionComparer : Implements IEqualityComparer(Of String) Public Function Equals1(s As String, t As String) As Boolean Implements IEqualityComparer(Of String).Equals Return String.Compare(s, t, StringComparison.OrdinalIgnoreCase) = 0 End Function Public Function GetHashCode1(s As String) As Integer Implements IEqualityComparer(Of String).GetHashCode Return s.GetHashCode() End Function End Class #End Region
#Region " Get MD5 Of File Function " ' [ Get MD5 Of File Function ] ' ' Examples : ' ' MsgBox(Get_MD5_Of_File("C:\Test.txt")) Private Function Get_MD5_Of_File (ByVal File As String) As String Using MD5_Reader As New System. IO. FileStream(File, IO. FileMode. Open, IO. FileAccess. Read) Using MD5 As New System.Security.Cryptography.MD5CryptoServiceProvider Dim MD5_Byte() As Byte = MD5.ComputeHash(MD5_Reader) Dim MD5_Hex As New System.Text.StringBuilder(MD5.ComputeHash(MD5_Reader).Length * 2) For Number As Integer = 0 To MD5_Byte.Length - 1 Application.DoEvents() MD5_Hex.Append(MD5_Byte(Number).ToString("X2")) Next Return MD5_Hex.ToString().ToLower End Using End Using End Function #End Region
...Aquí más -> Librería de Snippets !! (Posteen aquí sus snippets)
|
|
|
8519
|
Programación / .NET (C#, VB.NET, ASP) / Re: Problema al convertir Bitmap a Ico
|
en: 19 Julio 2013, 22:12 pm
|
Después de hacer un largo research por Google para buscar la mejor manera de este tipo de conversión, me he dado cuenta que el formato ICO en .NET solo son problemas y es casi imposible hablar de ICO + Transparencia en las Classes del framework, y después de pelear mucho con la librería FreeImage, al final he optado por usar un wrapper de esta lib para .NET, y aquí está el code que hice de prueba, funciona: Imports FreeImageAPI 'Dim img As FreeImageAPI.FIBITMAP = FreeImage.Load(format, file, FREE_IMAGE_LOAD_FLAGS.ICO_MAKEALPHA) Public Class Form1 Dim file As String = "C:\Users\Administrador.ELEKTRO-PC\Desktop\auricular 5.png" Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Shown Dim format As FreeImageAPI. FREE_IMAGE_FORMAT = FreeImage. GetFileType(file, 32) Dim img As FreeImageAPI. FIBITMAP = FreeImage. LoadEx(file) Dim Transparency As Byte() = New Byte(0) {} FreeImage.SetTransparencyTable(img, Transparency) FreeImage.Save(FREE_IMAGE_FORMAT.FIF_ICO, img, "c:\test.ico", FREE_IMAGE_SAVE_FLAGS.DEFAULT) End Sub End Class
|
|
|
|
|
|
|