Re: saved bitmap size



I know, but I need .bmp file :-)
 
Greetz Peter

--
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
u can change extenison u want.ico, jpg or bmp etc

Peter Proost wrote:
Hi supra, thanks for your answer, it works but in some picture programms it
gives a warning because it's actualy a jpeg image with a bmp extension

Greetz Peter

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning.

"Supra" <supra@xxxxxxxxxxxxxx> schreef in bericht
news:4fSdnT2hhPhuQ1XfRVn-iw@xxxxxxxxxx...
  
i proost,
i created  compressed bmp. there is not control to be added.

Option Explicit On
Option Strict Off
Imports System.Drawing.Imaging
Imports System.IO
Module ImageCompression

    Private Function GetEncoderInfo(ByVal mimeType As String) As
ImageCodecInfo
        Dim i As Integer
        Dim Encoders() As ImageCodecInfo =
    
ImageCodecInfo.GetImageEncoders()
  
        For i = 0 To Encoders.Length - 1
            If Encoders(i).MimeType = mimeType Then
                Return Encoders(i)
            End If
        Next
        Return Nothing
    End Function

    Public Sub main()
        Dim codecInfo As ImageCodecInfo = GetEncoderInfo("image/jpeg")
        Dim enc As Encoder = Encoder.Quality
        Dim EncParams As New EncoderParameters(1)
        Dim Dir As New DirectoryInfo(Directory.GetCurrentDirectory())
        Dim image As Image = image.FromFile("C:\Documents and
Settings\My Documents\Visual Studio Projects\VbNet\project\Image
Compression\bin\supra_1.bmp")
        Dim jpgName As String
        EncParams.Param(0) = New EncoderParameter(enc, 25L)
        jpgName = Path.GetFileNameWithoutExtension("C:\Documents and
Settings\My Documents\Visual Studio Projects\VbNet\project\Image
Compression\bin\supra_1.bmp") & "0" & ".bmp"
        image.Save(jpgName, codecInfo, EncParams)
    End Sub
End Module

hth.
regards

Peter Proost wrote:

    
Hi group, I've got a question about the size of a saved bitmap.
What I need to do is open a bitmap if it needs resizing, resize and save
      
it.
  
This isn't a problem, but the problem I have is that the original image
      
has
  
got an 8 bit indexed pixelformat,
but you can't create a graphics object for this pixelformat so my bitmap
uses the default pixelformat:
Format32bppArgb, but this ofcourse result in a much larger file size
      
(420kB
  
instead of 106kB)
I know I can use for example Format24bppRgb and this reduces the size to
300kB but I would like to know if I there's a way I can keep the size at
106kB

Thanks in advance

Greetz Peter




      


  


Relevant Pages

  • Re: saved bitmap size
    ... to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. ... So far, the Universe is winning. ... striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. ... Dim i As Integer ...
    (microsoft.public.dotnet.languages.vb)
  • Re: printing from a rich text box
    ... to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. ... So far, the Universe is winning. ... MyBase.OnPrintPageStatic intCurrentChar As Integer Dim intPrintAreaHeight, intPrintAreaWidth, _ intMarginLeft, intMarginTop As Integer ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Macro to increment field by one- suggestions?
    ... Is the bigger number XXXX001ZZZZZ alphanumeric as the ... Dim hfRange As Range ... the footer and change the number to read 001 or anything else. ... (I don't want to increment the field just because I'm fixing ...
    (microsoft.public.word.vba.general)
  • Re: saved bitmap size
    ... to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. ... So far, the Universe is winning. ... striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. ... Dim i As Integer ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Fill data toCombo box from dataset
    ... Hi this bit of code shows you how to fill a combo with a sqldatareader (to ... Dim rdrReader As SqlDataReader ... bigger and better idiots. ... So far, the Universe is winning. ...
    (microsoft.public.dotnet.languages.vb)

Loading