473,414 Members | 1,766 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,414 software developers and data experts.

How to save a bitmap ?

I´ve created a Bitmap in C# during runtime from a lbl-Field:

Bitmap noise = new Bitmap(lblPaint.Width, lblPaint.Height,
PixelFormat.Format16bppRgb555);

System.Drawing.Bitmap flag = new System.Drawing.Bitmap(10, 10);
for( int x = 0; x < flag.Height; ++x )
{
for( int y = 0; y < flag.Width; ++y )
{
noise.SetPixel( x, y, flag.GetPixel(x,y));
}
}

How can I save this image to a file ? (Streams, Filewriter ?).

Thanks,
F.Trebus
--
MfG FT

Auf dieses Posting bitte nicht via E-Mail antworten !
Diese E-Mail-Adresse ist nur im Usenet gültig und wird nicht
abgerufen !
Nov 15 '05 #1
2 2225
noise.Save(fileName, ImageFormat.Bmp);
--
Justin Rogers
DigiTec Web Consultants, LLC.

"Frank Trebus" <us****@trebus.de> wrote in message
news:bu*************@news.t-online.com...
I´ve created a Bitmap in C# during runtime from a lbl-Field:

Bitmap noise = new Bitmap(lblPaint.Width, lblPaint.Height,
PixelFormat.Format16bppRgb555);

System.Drawing.Bitmap flag = new System.Drawing.Bitmap(10, 10);
for( int x = 0; x < flag.Height; ++x )
{
for( int y = 0; y < flag.Width; ++y )
{
noise.SetPixel( x, y, flag.GetPixel(x,y));
}
}

How can I save this image to a file ? (Streams, Filewriter ?).

Thanks,
F.Trebus
--
MfG FT

Auf dieses Posting bitte nicht via E-Mail antworten !
Diese E-Mail-Adresse ist nur im Usenet gültig und wird nicht
abgerufen !

Nov 15 '05 #2
Justin Rogers schrieb:
noise.Save(fileName, ImageFormat.Bmp);


OK. This works, but the image is always black.
I painted some structures in a lbl-Field. How can I now get the color
information from every pixel in this field ? Is there a method for
Label-Fields or do I have to use another control item ?

Thank you very much !
--
MfG FT

Auf dieses Posting bitte nicht via E-Mail antworten !
Diese E-Mail-Adresse ist nur im Usenet gültig und wird nicht
abgerufen !
Nov 15 '05 #3

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

Similar topics

6
by: charsh | last post by:
Hi, I using the code below to draw a text in a pictureBox1. //Start--------------------------------------------------------------- private void button1_Click(object sender, System.EventArgs e)...
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...
12
by: yaya via DotNetMonster.com | last post by:
Hi, I have a picture box with circles and rectangles, and I wana save all the images into a jpg file, i tried pictureBox1.Image.Save(@"c:\1.jpg"); but I got and error...
2
by: Olaf Baeyens | last post by:
I want to convert one bitmap file to another one. For example load as bmp and save as jpg. The loading part is simple I do this: Stream BitmapStream =...
2
by: Peter Proost | last post by:
Hi group when save a bitmap called saveBmp like this: <<<< saveBmp.Save(filename, ImageFormat.Jpeg) <<<< the bitmap gets saved with it's size propertys, so if I right click the file and...
1
by: WB | last post by:
Hi, I have a helper class that has a method to resize images. It takes the virtual path of an image and resize it to a specified dimension like this. public void ResizeImageTest(string...
1
by: Stedak | last post by:
I have the following class I use to save Tiff's. The problem I have with it is that the final size of the images are very large. If we scan directly to a file the final tiff may be 600-900 kb.s but...
12
by: Lee | last post by:
I have the following code using System; using System.Windows.Forms; using System.Drawing; using System.Collections; namespace FINN {
13
by: Joe | last post by:
does anyone know why this source code throws an error?? Dim myBitmap As System.Drawing.Bitmap Dim myGraphics As Graphics myBitmap = New System.Drawing.Bitmap(fileName:="C:\test.tif")...
2
by: Piotrekk | last post by:
Hi I have a problem. I open bitmap file, load it to memory decrease color palette by proceeding Euclidean distance. As a result i have image reduced to - for example 18 colors. Once i save it -...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
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...
0
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...
0
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...

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.