C
cdvolko
Hi,
I'm looking for code to load and save bitmap files (24 bit per pixel).
TIA
Claus
I'm looking for code to load and save bitmap files (24 bit per pixel).
TIA
Claus
Hi,
I'm looking for code to load and save bitmap files (24 bit per pixel).
TIA
Claus
Have a look at System.Drawing.Bitmap and System.Drawing.Image.
I've done that. And I've written my program. But when trying to
compile it, I get the error CS0234: The type or namespace name Drawing
does not exist in the namespace system (Is an assembly reference
missing?). What's wrong? Here's my code:
Have a look at System.Drawing.Bitmap and System.Drawing.Image.
I've done that. And I've written my program. But when trying to
compile it, I get the error CS0234: The type or namespace name Drawing
does not exist in the namespace system (Is an assembly reference
missing?). What's wrong? Here's my code:
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.IO;
namespace Border
{
class Program
{
static void Main(string[] args)
{
String filename;
Bitmap myBitmap;
Console.WriteLine("Source file name:");
filename = Console.ReadLine();
myBitmap = new Bitmap(filename);
if (myBitmap == null)
{
Console.WriteLine("Error: File not found!");
return;
}
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < myBitmap.Width; j++)
{
myBitmap.SetPixel(j, i, Color.Black);
myBitmap.SetPixel(j, myBitmap.Height - i,
Color.Black);
}
for (int j = 0; j < myBitmap.Height; j++)
{
myBitmap.SetPixel(i, j, Color.Black);
myBitmap.SetPixel(myBitmap.Width - i, j,
Color.Black);
}
}
myBitmap.Save(filename);
}
}
}
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.