View previous topic :: View next topic |
Author |
Message |
jicman
Joined: 22 Dec 2004 Posts: 298 Location: Rochester, NY
|
Posted: Sat Nov 08, 2008 1:37 pm Post subject: Getting the width, size and length of an image |
|
|
Greetings!
I am trying to find the height and width of an image with this little program,
Code: | import std.stdio;
import std.string;
import dfl.all;
void main() {
auto picture = new PictureBox;
picture.image = new Picture("psipmain.JPG");
writefln("width = " ~ std.string.toString(picture.image.width));
writefln("height = " ~ std.string.toString(picture.image.height));
//picture.dispose();
} |
I see the dispose() function there and I am wondering how is it use? I am opening thousands of pictures and all I am doing is just getting their size and then creating an HTML report on the whole directory structure. When do I use dispose to clean the memory? Or is this even what this function is for?
thanks,
jose |
|
Back to top |
|
|
Chris Miller
Joined: 27 Mar 2004 Posts: 514 Location: The Internet
|
Posted: Mon Nov 10, 2008 4:04 pm Post subject: Re: Getting the width, size and length of an image |
|
|
The dispose method releases the internal image resources. You can call it when you're done with a Picture instance. |
|
Back to top |
|
|
jicman
Joined: 22 Dec 2004 Posts: 298 Location: Rochester, NY
|
Posted: Mon Nov 10, 2008 6:35 pm Post subject: |
|
|
If I do use it, for example, in the code above, if I uncomment it, the height and width never get displayed. So, perhaps I should use it at the beginning. |
|
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
|