473,320 Members | 2,161 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

saved bitmap size

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
Nov 21 '05 #1
9 1659
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

Nov 21 '05 #2
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" <su***@domain.invalid> schreef in bericht
news:4f********************@rogers.com...
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 hasgot 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 (420kBinstead 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

Nov 21 '05 #3
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" <su***@domain.invalid> schreef in bericht
news:4f********************@rogers.com...

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




Nov 21 '05 #4
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.

"Supra" <su***@domain.invalid> schreef in bericht news:Ha********************@rogers.com...
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" <su***@domain.invalid> schreef in bericht
news:4f********************@rogers.com...
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



Nov 21 '05 #5
rephrase it "but I need .bmp file" ..what do u mean....u can't find file?
regards

Peter Proost wrote:
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.

"Supra" <su***@domain.invalid <mailto:su***@domain.invalid>>
schreef in bericht news:Ha********************@rogers.com...
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" <su***@domain.invalid> schreef in bericht
news:4f********************@rogers.com...

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




Nov 21 '05 #6
I mean I need to save it as .bmp file, and with your encoder parameters it becomes a jpeg but with a .bmp extension and some imaging programms have problems with this

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" <su***@domain.invalid> schreef in bericht news:sK********************@rogers.com...
rephrase it "but I need .bmp file" ..what do u mean....u can't find file?
regards

Peter Proost wrote:

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.

"Supra" <su***@domain.invalid> schreef in bericht news:Ha********************@rogers.com...
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" <su***@domain.invalid> schreef in bericht
news:4f********************@rogers.com...
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



Nov 21 '05 #7


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


I've had a little look around, and basically I think you're stuck :(

At present it seems GDI+ just *doesn't do* indexed bitmaps, even the
estimable Bob Powell GDI+ FAQ site has to skirt round these. So if you
want to create or update these, I think your choice is either wait for
a newer version of the framework (and I'm not sure 2.0 is going to do
these), or:

Go down to the bits and bytes yourself... which probably wants to be
done in C# in unsafe code for performance, which - if it sounds like
your thing - is probably great fun, but not something I would like to
try myself...

--
Larry Lard
Replies to group please

Nov 21 '05 #8
i did test my owned bmp and the file size is 3.6 mb and downsizing to
67kb and i saved as supra.bmp.
i don't know if this website could help u.
http://www.devx.com/dotnet/Article/18163/0/page/3
regards

Peter Proost wrote:
I mean I need to save it as .bmp file, and with your encoder
parameters it becomes a jpeg but with a .bmp extension and some
imaging programms have problems with this

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" <su***@domain.invalid <mailto:su***@domain.invalid>>
schreef in bericht news:sK********************@rogers.com...
rephrase it "but I need .bmp file" ..what do u mean....u can't
find file?
regards

Peter Proost wrote:
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.

"Supra" <su***@domain.invalid <mailto:su***@domain.invalid>>
schreef in bericht news:Ha********************@rogers.com...
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" <su***@domain.invalid> schreef in bericht
news:4f********************@rogers.com...
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
>
>
>
>
>
>


Nov 21 '05 #9
Thanks for the link supra, it's helpfull but I think Larry is right, that I'm a bit stuck for the 8 bit indexed pixel format, but it isn't a big disaster, only bigger images :-)

Thanks and 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" <su***@domain.invalid> schreef in bericht news:lP********************@rogers.com...
i did test my owned bmp and the file size is 3.6 mb and downsizing to 67kb and i saved as supra.bmp.
i don't know if this website could help u.
http://www.devx.com/dotnet/Article/18163/0/page/3
regards

Peter Proost wrote:
I mean I need to save it as .bmp file, and with your encoder parameters it becomes a jpeg but with a .bmp extension and some imaging programms have problems with this

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" <su***@domain.invalid> schreef in bericht news:sK********************@rogers.com...
rephrase it "but I need .bmp file" ..what do u mean....u can't find file?
regards

Peter Proost wrote:

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.

"Supra" <su***@domain.invalid> schreef in bericht news:Ha********************@rogers.com...
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" <su***@domain.invalid> schreef in bericht
news:4f********************@rogers.com...
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



Nov 21 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Mark Johnson | last post by:
How can you save all or a portion of the Grafics object to a Image/Bitmap ? I am try to save the Images from Cards.dll to a BitMap file. I can read in the Images to the Grafics, but when I try this...
2
by: Sharon | last post by:
I encountered a strange behavior when doing ‘new Bitmap’: The following code works fine and the given bitmap file is shown on the PictureBox (the m_DrawArea) in the correct bitmap sizes: ...
9
by: charliewest | last post by:
Hello - I have images saved in my SQL SERVER 2000 database. Using ASP.NET (C#) is there any way to temporarily save an image to a session object, and after running some other operations, later...
2
by: Peter Proost | last post by:
Hi group I have the following piece of code that should resize the bitmap in a picture box but it doesn't work as I tought it would. Can someone help me with it? thnx Peter Public Class...
2
by: Mad Scientist Jr | last post by:
I have a bitmap (32 pixels high, 8192 pixels wide) that contains 255 images, each 32 pixels wide, that I would like to chop up into individual 32x32 bitmap files. Rather than spending hours in...
2
by: ioanabratu | last post by:
I'm drawing dynamically on a bitmap.I want to be able to save the bitmap in the database as a JPG. I am using the following code to draw and get the bytes for the database. The image saved in the...
0
by: Duracel | last post by:
Hi, I've got a routine that fetches a bitmap from a COM server and converts it into a .NET format bitmap. The original DIB surface is 24 bit. When blitting this bitmap to a window, the speed...
4
by: MikeB | last post by:
Hello All, want to be able to pull images from the database and load them into a bitmap through a stream which I have working. I then want to take the bitmap and load it into a Image control...
2
by: Peter Oliphant | last post by:
I want to create a new Bitmap which is a portion of an existing Bitmap. For example, if I have a Bitmap that is 100x100 in size I might want to create a new Bitmap that is equivalent to the one...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.