Re: Is there a free .GIF software?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




"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@xxxxxxxxxxxxxxxxxxxxxxx
hmm..
C# :)

Mythran

"Doru Roman" <doruroman@xxxxxxxxxx> wrote in message news:eWsiQT2TGHA.5552@xxxxxxxxxxxxxxxxxxxxxxx
Hi,

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

.



Relevant Pages

  • Reading all frames and information of GIF [solution]
    ... Well, I've been bussy with a gif loader, because I needed all the frames. ... For each frame, the function addFrame(Image image, ... private static final String NODEPATH_HEIGHT = ... int imageHeight = Integer.parseInt(findValueWithPath(streamRoot, ...
    (comp.lang.java.programmer)
  • How to retrieve a text string information
    ... A new feature I've recently implemented allows for changing the canvas ... information and apply the proper text coordinates rescaling. ... which information about the single text string shall I ... other corner), the number of characters, the character font (which ...
    (comp.lang.tcl)
  • Re: Window not mapped while creating image
    ... I am trying to export the content of a canvas to a GIF file (or ... package require Img ...
    (comp.lang.tcl)
  • Re: Canvas text with different fonts and faces
    ... with different fonts and faces within the string by using html tags. ... items and do calculation on placement, or to place a text widget. ... text item in a canvas? ...
    (comp.lang.tcl)
  • RE: button color dont match background color
    ... mask the GIF or select the background (canvas) as transparent. ... I use lot of graphics (usually .gif) to make buttons for my Access ... having the red circle and partially the canvas. ...
    (microsoft.public.access.forms)