Re: Is there a free .GIF software?
- From: "Mythran" <kip_potter@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 27 Mar 2006 09:49:33 -0800
"Doru Roman" <doruroman@xxxxxxxxxx> wrote in message news:Ow6mNHcUGHA.4300@xxxxxxxxxxxxxxxxxxxxxxx
Thanks for the reply Mythran.
So C# is capable of doing that? How?
"Mythran" <kip_potter@xxxxxxxxxxxxxxxxxxxxxx> wrote in message news:OjsFaC5TGHA.5332@xxxxxxxxxxxxxxxxxxxxxxxhmm..
C# :)
Mythran
"Doru Roman" <doruroman@xxxxxxxxxx> wrote in message news:eWsiQT2TGHA.5552@xxxxxxxxxxxxxxxxxxxxxxxHi,
Is there a free software to generate .GIF files?
If not, what is recommended?
Thanks,
Doru
The System.Drawing namespace, using System.Drawing.Bitmap and System.Drawing.Graphics objects can be used to create GIF images...below is an example of creating an image of type GIF that has the time created display in it. With some background coloring and borders (simple borders).
Bitmap bmp;
Graphics canvas;
string time = DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss");
Font font = new Font("Arial", 52);
SizeF size;
// Create the bitmap and measure the size of the string.
using (bmp = new Bitmap(1, 1)) {
using (canvas = Graphics.FromImage(bmp)) {
// Measure the string.
size = canvas.MeasureString(time, font);
}
}
// Create a new bitmap that will contain the string.
int width = (int) (size.Width);
int height = (int) (size.Height);
using (bmp = new Bitmap(width, height)) {
using (canvas = Graphics.FromImage(bmp)) {
// Prepare the canvas.
canvas.InterpolationMode =
InterpolationMode.HighQualityBilinear;
// Draw the background.
canvas.Clear(Color.BlanchedAlmond);
// Draw the border.
canvas.DrawRectangle(
Pens.Magenta,
0,
0,
width - 1,
height - 1
);
// Draw the string onto the canvas.
canvas.DrawString(time, font, Brushes.Blue, 0, 0);
}
// Save the image to disk.
bmp.Save(
@"C:\images\myImage.gif",
System.Drawing.Imaging.ImageFormat.Gif
);
}
Console.WriteLine("Image saved.");
HTH :)
Mythran
.
- References:
- Is there a free .GIF software?
- From: Doru Roman
- Re: Is there a free .GIF software?
- From: Mythran
- Re: Is there a free .GIF software?
- From: Doru Roman
- Is there a free .GIF software?
- Prev by Date: Re: Is there a free .GIF software?
- Next by Date: How to get underlying data of TreeView control? (ASP.NET 2.0)
- Previous by thread: Re: Is there a free .GIF software?
- Next by thread: Re: Is there a free .GIF software?
- Index(es):
Relevant Pages
|