473,890 Members | 1,960 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

bitmap save info

Hi group when save a bitmap called saveBmp like this:

<<<<
saveBmp.Save(fi lename, ImageFormat.Jpe g)
<<<<

the bitmap gets saved with it's size propertys, so if I right click the file
and select propertys I can see the width and the height of the image. But if
I save the bitmap as a bitmap:

<<<<
saveBmp.Save(fi lename, ImageFormat.Bmp )
<<<<

this information doesn't get saved, is there something I can do about this,
should I declare the bitmap in a specified format?

I already found the answer while typing this post but I'm still going to
post it because maybe it's useful for someone else. The solution is to
create the bitmap as follows:

<<<<
saveBmp = new bitmap (width,height, PixelFormat.For mat24bppRgb)
<<<<
Nov 21 '05 #1
2 1685
Peter,

When you have the answer this is not a good post, this will be opened again
and again because somebody is thinking you have a question, therefore this
message.

When you do this the least you have to do is to tell in the subject that it
is not a question.

Cor

"Peter Proost"
Hi group when save a bitmap called saveBmp like this:

<<<<
saveBmp.Save(fi lename, ImageFormat.Jpe g)
<<<<

the bitmap gets saved with it's size propertys, so if I right click the
file
and select propertys I can see the width and the height of the image. But
if
I save the bitmap as a bitmap:

<<<<
saveBmp.Save(fi lename, ImageFormat.Bmp )
<<<<

this information doesn't get saved, is there something I can do about
this,
should I declare the bitmap in a specified format?

I already found the answer while typing this post but I'm still going to
post it because maybe it's useful for someone else. The solution is to
create the bitmap as follows:

<<<<
saveBmp = new bitmap (width,height, PixelFormat.For mat24bppRgb)
<<<<

Nov 21 '05 #2
Thnx for pointing that out for me Cor, it won't happen again, my you can
help me with my next question, look at the post with bitmap resize as
subject
thnx Peter
"Cor Ligthert" <no************ @planet.nl> wrote in message
news:#R******** ******@TK2MSFTN GP12.phx.gbl...
Peter,

When you have the answer this is not a good post, this will be opened again and again because somebody is thinking you have a question, therefore this
message.

When you do this the least you have to do is to tell in the subject that it is not a question.

Cor

"Peter Proost"
Hi group when save a bitmap called saveBmp like this:

<<<<
saveBmp.Save(fi lename, ImageFormat.Jpe g)
<<<<

the bitmap gets saved with it's size propertys, so if I right click the
file
and select propertys I can see the width and the height of the image. But if
I save the bitmap as a bitmap:

<<<<
saveBmp.Save(fi lename, ImageFormat.Bmp )
<<<<

this information doesn't get saved, is there something I can do about
this,
should I declare the bitmap in a specified format?

I already found the answer while typing this post but I'm still going to
post it because maybe it's useful for someone else. The solution is to
create the bitmap as follows:

<<<<
saveBmp = new bitmap (width,height, PixelFormat.For mat24bppRgb)
<<<<


Nov 21 '05 #3

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

Similar topics

1
2106
by: someone | last post by:
Please bear with me, since I'm an ASP guy, and not a .NET guy. On my site, I dynamically resize/resample images so they're not too large. GetThumbnail resulted in very poor quality, so I create a new System.Drawing.Image. It works pretty well for large images that are resized quite a bit, but if the original image is fairly close to the new size, there's a visible quality loss. I've come across some info on how you set this, but I'm not...
9
2651
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 with a Bitmap the results are Black. Can you somehow Clip the Grafic and Paste it into the Bitmap ? Mark Johnson, Berlin Germany mj10777@mj10777.de
0
3627
by: CroDude | last post by:
Hi all! I have problems when writting bitmap to a byte array and after reading it back form byte to Bitmap object. What I do is this: First I throw Bitmap to a memory-stream and then I write it into byte from a stream. Exception (System.ArgumentException: Invalid parameter used) occurs when reading from byte over a memory-stream back to the Bitmap object. Please help, I'm really stuck here! Here's the code I use (Sorry for a long...
2
6708
by: active | last post by:
I find Bitmap.Save works for WMF files but Bitmap.FromFile does not. If I use FromFile on a WMF file that came with VS I get an exception. If I use it on a WMF file created with Bitmap.Save I don't get an exception but it appears the Bitmap is blank. Can anyone share some knowledge on this?
6
3773
by: Lespaul36 | last post by:
From what I have read, there isn't really a converter to icon format..it becomes a png file. I tried: 1: Dim bmp As Bitmap = CType(Bitmap.FromFile("C:\myfolder\file.bmp"), Bitmap) 2: Dim ico As Icon = Icon.FromHandle(bmp.GetHicon()) 3: Dim file As FileStream = New FileStream("C:\myfolder\file.ico",FileMode.OpenOrCreate) 4: ico.Save(file) 5: file.Close()
8
3338
by: Nathan Sokalski | last post by:
I am trying to write code to rotate a graphic that I have. Here is the code I am currently using: Dim frogbitmap As New Bitmap(Drawing.Image.FromFile(Server.MapPath("images/frog.gif"))) Dim froggraphic As Graphics = Graphics.FromImage(frogbitmap) froggraphic.RotateTransform(90) frogbitmap.Save(Server.MapPath("images/frog2.gif"), Imaging.ImageFormat.Gif)
7
2326
by: Nathan Sokalski | last post by:
I am having a problem saving an image with the same name it originally had. I have two similar versions of my code, one in which I close the FileStream used to open the original image before saving, the other in which I close the FileStream afterwards, although both return the same error. Here are the two versions of the code and the errors they each return (NOTE: I rebooted immediately before running each of these versions so that I knew they...
12
2021
by: tjonsek | last post by:
I get a generic error (not very helpful) when attempting to save a re-sized image back to its original location. Here is the code snippet: Dim g As System.Drawing.Image = System.Drawing.Image.FromFile(Me.File1.Value) Dim thisFormat = g.RawFormat Dim imgOutput As New Bitmap(g, 800, 600) Dim strFileType As String Dim strFileName As String = File1.PostedFile.FileName
3
3940
by: Samuel | last post by:
I need to read a tiff Image and change it slightly. Currently I create a bitmap then I draw the original image and do the changes. Since the tiff is very large in size the bitmap takes a huge amount of memory Is there anyway to create a bitmap and keep the image compressed?
0
9814
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11214
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10801
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10903
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10449
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9616
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8006
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6034
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4257
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.