FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Juno.media not support gif image type ?

 
Post new topic   Reply to topic     Forum Index -> Juno
View previous topic :: View next topic  
Author Message
yidabu



Joined: 21 Apr 2007
Posts: 87

PostPosted: Wed Sep 12, 2007 5:48 am    Post subject: Juno.media not support gif image type ? Reply with 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!

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
View user's profile Send private message
John



Joined: 17 Jan 2006
Posts: 75

PostPosted: Sat Sep 15, 2007 4:21 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Juno All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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