View previous topic :: View next topic |
Author |
Message |
yidabu
Joined: 21 Apr 2007 Posts: 87
|
Posted: Wed Sep 12, 2007 5:48 am Post subject: Juno.media not support gif image type ? |
|
|
I update Juno to svn 155 today, deleted wrong import of DayOfWeek in juno.locale.format, use a bat file to build Juno, succeeded!
then test build a simple example, got a lot of compile time error:
Quote: | Symbol Undefined.... |
Code: | import std.file;
import juno.media.all;
pragma(lib, "juno.lib");
void main()
{
string imgin = r"D:\My Documents\My Pictures\test.gif";
string imgout = r"D:\My Documents\My Pictures\new.gif";
assert(std.file.exists(imgin));
// Create a bitmap from image file.
auto image = new juno.media.core.Bitmap(imgin);
// Get the bitmap's drawing surface
auto graphics = juno.media.core.Graphics.fromImage(image);
// Create a font
auto font = new Font("Arial", 10, FontStyle.Bold);
// Create a brush
auto brush = new SolidBrush(Color.aliceBlue());
// Draw the text on the surface
//~ graphics.clear(Color.aliceBlue);
graphics.drawString("hello, Juno", font, brush, 10, 10);
// Save the image to a file
image.save(imgout);
} |
I try to build juno library by DSSS, replaced GUID in media.core with juno.com.core.GUID, then succeeded.
I build example program above, got run time error :
Quote: | Error: OutOfMemoryException: Out of memory. |
what's wrong with the code ?
I just change the image type to jpeg, no error occur, does juno.media not support gif image type ? would you please help out with this ?
Thanks much in advance. |
|
Back to top |
|
|
John
Joined: 17 Jan 2006 Posts: 75
|
Posted: Sat Sep 15, 2007 4:21 am Post subject: |
|
|
Quote: | I update Juno to svn 155 today, deleted wrong import of DayOfWeek in juno.locale.format, use a bat file to build Juno, succeeded!
|
Download the zipped files instead and there should be no compile-time errors. (I haven't got around to syncing the files.)
Quote: | I build example program above, got run time error |
It's a limitation with GDI+ - GIF are indexed images and you can't get the graphics context of indexed images. I need to throw a better exception.
You could programmatically convert the GIF to a PNG, get the graphics context of the PNG, manipulate it, then save back to a GIF. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|