Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Anyone fancy a REAL challenge? (Image Magick)

Author
Message
Ric
19
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 13th Jul 2007 20:02
Imagemagick (http://www.imagemagick.org/script/index.php) is a set of open source image processessing functions, with massive potential. It can convert images from any format to any other (including svg vector graphics images that can be scaled indefinitely with no loss of quality), and it can do pretty much anything with an image that photoshop can do, including image manipulation, vector drawing and text rendering (with antialiasing) and batch processing. It has a wrapper for pretty much every language out there - except for DBPro. It looks to me like something that would be a huge improvement on the 2d image features currently in DBPro.

Hands up who would like a piece of that!

So, all we need is someone with the know how and the enthusiasm, to wrap it for dbpro. There is already a high level wrapper for C called Magickwand, and a wrapper for C++ called Magick++, either of which could easily (probably) be converted into a dll for DBPro by someone who knows how. I'd have a go at it myself, except for the fact that a) it's a bit over my head and b) it won't build with the two free compilers I have (Dev C++ or VS 2005 express) - apparantly it only works with the full version of Visual Studio or Borland (something about needing the Microsoft Foundation Class or somethigorother ...)

Anyone interested?

vorconan
17
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Wales
Posted: 13th Jul 2007 21:37
Sounds awesome, I'd love to see someone do it

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 14th Jul 2007 01:45
For the record, I tried to call it directly from DB Pro and failed miserably I can initiate it, but anything else just doesn't get recognised.

I agree with Ric, the potential is huge. For me, the ability to resize images using complex algorithms to maintain quality is what I want.

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 14th Jul 2007 02:13
I would have done it, but the whole needing the full version of Visual Studio draws me back a bit

"It's like floating a boat on a liquid that I don't know, but I'm quite happy to drink it if I'm thirsty enough" - Me being a good programmer but sucking at computers
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 14th Jul 2007 02:49
I have that, but it's the size of the API that bothers me - there's just so much to wrap, it's unreal.

The fact that I have PSP8 with scripting built in also makes it seem less worthwhile. Even the free GIMP has scripting (if you don't like the scheme language, plug perl or python into it instead).

It's also unlikely that this library will run fast enough to provide real-time effects, though I guess it may be useful for utilities.

So, why is it needed, and how much of it?

Ric
19
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 14th Jul 2007 11:48
It is a big api and wrapping the whole thing would take a considerable time investment. I also agree, that the speed of doing image processessing would make this more useful for an application than for real time effects in a game. But, then, DBPro is advertised as an application builder (It has "write incredible 3d games, applications and presentations" written on the box!) I also have a feeling, that applications written in dbpro have possibly had, and have the potential for more commercial success than games. With something like BlueGUI and an Imagemagick plugin, you could write all sorts of applications that involve or output 2d grahics.

Let's say someone wanted to write an application that creates, or allows the user to create textures or images - perhaps a small program to create buttons for website graphics. Just wrapping the readimage and writeimage methods alone would allow the program to load and save images into any image format (gif format would probably be useful for them).

Alos, as Batvink said, drawing and scaling images in the svg format would allow you to output images from your application of any size, with no loss of quality.

Well that's just me - lets see how much interest this thread gets - perhaps other people would have other uses?

If anyones interested, here's my thread on the imagemagick forum, where I have experimented a little, like Batvink, with the call dll command: http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=9190&sid=6d3ee0f3517027716ae9ca4ee19398ef

vorconan
17
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Wales
Posted: 14th Jul 2007 16:07
Looks like you're getting somewhere at least


BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 14th Jul 2007 17:09
The best use I can describe is user graphics. For example, allowing a user to add their own photo, avatar or logo to a game. Which is better...

Option 1: Please use a bmp, png or jpg file that is exactly 300 x 300 pixels

Option 2: Select any image. For best results,ensure it as at least 300 x 300 pixels

RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 14th Jul 2007 18:46
Ian you could always start on it and post your work. When you get tired of it, someone else might pick it up for a bit seeing as it's on it's way. After a few months of different people working on it, it'll be done. Theres tonnes of C++ Wizards on devhat, maybe they'd have a crack.


Crit
17
Years of Service
User Offline
Joined: 24th May 2006
Location:
Posted: 14th Jul 2007 18:58
Ric, maybe try initializing the call to magickreadimage with the path to the dlls.

result=call dll(1,"MagickReadImage",magick_wand,"[path to imagemagic dlls]");

Quote: "
Please note that under Windows (and possibly the Mac) it is necessary to initialize the ImageMagick library prior to using the Magick++ library. This initialization is performed by passing the path to the ImageMagick DLLs (assumed to be in the same directory as your program) to the InitializeMagick() function call. This is commonly performed by providing the path to your program (argv[0])
"


in c++, argv[0] is the path to your program
search for argv[0] here:
http://www.imagemagick.org/script/magick-wand.php

http://www.imagemagick.org/Magick++/
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 14th Jul 2007 20:12 Edited at: 14th Jul 2007 20:33
I am No expert on this, but I know that jinzai as a lot knowledge on doing something like this, if you look at the One wire weather station project or jinzai how to find your IP address this may give you some clues on what you may need to do to get the plug in working.

One wire weather station project

and finding IP address code.
http://forum.thegamecreators.com/?m=forum_view&t=107388&b=1

hope this might show how to call some of the API and get someone going.

Dark Physics makes any hot drink go cold.
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 14th Jul 2007 21:12
Quote: "Ian you could always start on it and post your work"

Ok, I'll take a look and see how best to wrap it.

I still need to know what people want to get out of it though. The only concrete requirement so far is 'load an image', and maybe 'resize an image' from Batvink, but that just scrapes the surface of what this library can do.

This is high-level from the web-site's front page:
* Format conversion: convert an image from one format to another (e.g. PNG to JPEG)
* Transform: resize, rotate, crop, flip or trim an image
* Transparency: render portions of an image invisible
* Draw: add shapes or text to an image
* Decorate: add a border or frame to an image
* Special effects: blur, sharpen, threshold, or tint an image
* Image calculator: apply a mathematical expression to an image or image channels
* Text & comments: insert descriptive or artistic text in an image
* Image identification: describe the format and attributes of an image
* Animation: create a GIF animation sequence from a group of images
* Composite: overlap one image over another
* Montage: juxtapose image thumbnails on an image canvas
* High dynamic-range imaging: accurately represent the wide range of intensity levels found in real scenes ranging from the brightest direct sunlight to the deepest darkest shadows
* Large image support: read, process, or write mega- and giga-pixel image sizes
* Threads of execution support: ImageMagick is thread safe and many internal algorithms are already threaded to take advantage of speed-ups offered by the dual and quad-core processor technologies.

If it's just 'load an image', that's dead easy. If more is required then that may affect how the functionality is wrapped up.

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 14th Jul 2007 22:35
* Format conversion: convert an image from one format to another (e.g. PNG to JPEG)
Good for unsupported formats
* Transform: resize, rotate, crop, flip or trim an image
rotate, crop, flip and trim can be done in DBP. But Resize in DBP gives poor results.
* Transparency: render portions of an image invisible
Already available through colorkey and alpha
* Draw: add shapes or text to an image
Available to a degree. Cloggy's D3D does nice antialiased text, and we can add basic shapes
* Decorate: add a border or frame to an image
Not rocket science to do in DBP
* Special effects: blur, sharpen, threshold, or tint an image
Would be nice
* Image calculator: apply a mathematical expression to an image or image channels
Must have a thousand uses, if it's generic
* Text & comments: insert descriptive or artistic text in an image
Not sure what uses this would have
* Image identification: describe the format and attributes of an image
Is this necessary?
* Animation: create a GIF animation sequence from a group of images
We have animated sprites already
* Composite: overlap one image over another
Nice
* Montage: juxtapose image thumbnails on an image canvas
Not really necessary
* High dynamic-range imaging: accurately represent the wide range of intensity levels found in real scenes ranging from the brightest direct sunlight to the deepest darkest shadows
For Skyboxes?
* Large image support: read, process, or write mega- and giga-pixel image sizes
Could be useful

vorconan
17
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Wales
Posted: 15th Jul 2007 00:24
Quote: "* Image calculator: apply a mathematical expression to an image or image channels"


Thats sounds awesome


Ric
19
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 15th Jul 2007 18:14
These are the aspects that I think would provide the most benefit for a general range of uses. Where I have made reference to actual functions, I'm referering to the Magickwand api for C, found here: http://www.imagemagick.org/script/magick-wand.php

Format conversion (MagickReadImage/MagickWriteImage)

Resizing/scaling - (MagickScaleImage/MagickResizeImage). You can choose the specific resizing algorithm you want, and resizing bitmap images gives better results than dbp, but more importantly, the resize features enable you to resize vector images, which is impossible in dbp.

Cropping, flipping and rotating - these kinds of things are possible in DBPro using sprites, but you then have to use the get image command to output it as an image or manipulate it further. Using 'get image' reduces quality, (I think it applies filtering, which alters the raw data of the image). Using memblocks can get tricky - so these functions would be a useful bonus.

Vector and text drawing. Things like DrawLine, DrawEllipse, DrawBezier, DrawRectangle, DrawAnnotation. Cloggy's d3d plugin is good for some of these, but has some issues in my experience - it works for me, but I had to remove it entirely from GUI Studio because it caused errors for other users. The options for drawing and text in Imagemagick are very versatile, too, with control over stroke width, fill colour, gradient fills etc. I'd especially like the text features, which would also mean wrapping the font and allignment methods.

Image effects: MagickGaussianBlurImage would be very useful - much more control than dbpro's blur bitmap command. MagickShadowImage (applies a drop shadow), MagickShadeImage (applies a distant light source to the image) and MagickRaiseImage (applies a sort of bevel) would be very nice features too.

Image Layering: Using the two functions MagickCompositeImage and MagickSetImageOpacity enable layering of one image over another - and there are a number of useful ways images can be added, like multiply, screen, difference etc. Could be done with memblocks, but very tricky.

There would also need to be a number of functions included for general functionality - things like changing stroke colour, creating/destroying/rendering 'wands' (from what I understand, wands are like separate images which can be named, and combined together - there are three varieties - magick wands, for image effects, drawing wands for vector drawing, and pixel wands for things like changing ink colour.) Also, for the Magickwand api at least, you need the functions 'MagickWandGenesis' and 'MagickWandTerminus' to inialise and terminate the process.

I think Ruccus has a good point - if someone like Ian would be willing to at least start this off, then I think that's probably the most difficult part. Once the framework is in place, anyone with a suitable compiler should be able to add functions reasonably easily, if the project is left open.

jinzai
17
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 15th Jul 2007 21:35
Ric, to be honest I have avoided your thread because I was all about getting GUIStudio, but my income has prevented that. Besides, I have yet to create the experiments to finish my DSP project. I did find this guy that built a sonar much like the one I'm building, but alas, I lost the link!

Now, the other reason is that I, ahem am owing someone some updated code from last week. Unfortunately, I recently developed a personal life which is keeping me away from more purely intellectual pursuits.

Of course I'd like to see that wrapped for use with DBPro. The process, while lengthy and a little tedious, is not onerous by any stretch. As HowDo pointed out, I have done alot of that type of work. I use VisualC++ 2003, which is a pretty complete system for working with DBPro.

I will get up to speed and open an interface to the dll the same way I always do. That will at least produce a set of source files. I want to point out that Microsoft Foundation Class is still available to those using third party compilers. You only lack the include files, and they are included along with the documentation on how to use them in the Platform SDK. (You know, I am going to start asking Bill for money when I put that pitch in for him.)
jinzai
17
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 16th Jul 2007 15:28 Edited at: 16th Jul 2007 15:31
Okay, that was alot of downloading and circular webpage navigation to find out that I could just use Standard Operating Procedures. After all of that, and some digging, I got told to copy the demo project files...

The function call that is required is called InitializeMagick. All it does is tell the core where the dlls are at. (AAAARRRRGGGHHHH! For over 15 years this has worked exactly the same way!) DLLs that are not plug-ins should be put in the application's directory (actually the worst choice, imo), Windows directory (outstanding choice), or Windows system directory (really only for drivers, and Windows components, but alot of low-level dlls are in there from alot of companies.)

I put all of the DLLs into c:/windows, and I naturally wrote as the first function in the plug-in:
int InitImageMagick(const char* lppath)

It is called from DBPro like this:
temp = InitImageMagick("c:/windows")

Now, this function calls the constructor of my class that will contain collections of each of the classes that ImageMagick exposes. They will be numbered on the DBPro side, just like other DBPro entities (e.g. objects, images, sounds, etc.)



The DLL contains one global pointer to the jzImageMagick wrapper class, and will expose access to it through DBPro-callable functions. At some point, I will write [again!] code to search for the DLLs. I'd rather say forget it, if they are not in the three directories that any brain-dead application gets searched for free, they are probably not there, but...Mom said to be nice. For now, I am going to handle it on the DBPro side by passing the correct answer in that string, since it works.

I can provide a framework that should be able to be used with most any compiler. The settings are not especially tricky. Paths to the include files, and libraries, along with library dependencies are the only new things. A standard plug-in stub suffices for starters.

The only real tricky part of this type of thing is setting up templates for using the C++ Standard Template Library, and that has already been done in the case of Magick++.

Should have some functionality by mid-week.
Ric
19
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 16th Jul 2007 17:53
Wahey! Great to have you on board Jinzai.

I wish I was clever enough to understand everything you just said, but for now I'll have to wait with anticipation to see what you can come up with! If the plugin needs a place to be hosted, let me know.

Btw, I have emailed you regarding other stuff.

Zerk
17
Years of Service
User Offline
Joined: 13th May 2006
Location: Orbiting Jupiter
Posted: 16th Jul 2007 17:58
Sounds like Ric wants some work done for free?

zParticle BETA finally released! An advanced particle system plugin for DBP!
More information and Download link!
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 16th Jul 2007 18:11
Quote: "Sounds like Ric wants some work done for free? "


Nah, the Kudos attached to getting this working is payment in full. This would be a fantastic addition.

Ric
19
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 16th Jul 2007 18:47
Quote: "Sounds like Ric wants some work done for free? "


I'm not after anything for free - if someone wants to make this into a plugin and charge for their time, that's entirely up to them. However, as Imagemagick is open source, they may well think that the aim of this kind of project is more about benefiting the community. As BV said, there are rewards in life other than money - kudos, appreciation, respect ......

Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 16th Jul 2007 19:51
If I wasn't up to my ears in projects already, I'd love to take this one on. Good luck to whoever decides to run with it.

-Ron

IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 16th Jul 2007 23:35
@jinzai,

If you are taking this on, great - I can be doing other things.

Have you tried looking into compiling the library as a static library instead of a DLL? That way you'll avoid any DLL conflicts (now or in the future - there are products that already use the library), or people forgetting to include the DLLs with any distribution of their code.

Vidiot
17
Years of Service
User Offline
Joined: 15th May 2006
Location: TN
Posted: 19th Jul 2007 20:50
I wish I could offer to help. But this is way over my head. All I can say is I really could use a high quality image resize function that can operate from within DBPro. Thats the one thing about my Digital Signage app that I'm not satisfied with. I tried different methods in DBPro and they produced very different results depending on the original image. Some would look perfect after a resize and others would look lousey regardless of the original's size.

Personally, I'm more of a graphics guy than a programmer so I'd likely be interested in ANY new graphic functions. If you want someone to help with testing this as it develops, I'd be glad to. I have Corel Draw and Photoshop so I can access ALOT of different image types.

The answer to Life, the Universe, and Everything? "Tea for Two". Deep Thought was Dyslexic.
Xolatron
18
Years of Service
User Offline
Joined: 12th Mar 2006
Location: The Star Forge Language: DBpro
Posted: 22nd Jul 2007 23:15 Edited at: 22nd Jul 2007 23:28
This looks really nice, and I'd be glad to see a DBp wrapper. Image conversion would be nice (since DBp doesn't support GIF images or interlaced jpegs)

As to the dlls, I find it's easiest to have the exe extract them on runtime and then call them, so only the exe file has to be distributed. I usually have one dirblock file and extract it to a "temp" folder in my app's directory.

As far as images go, though: In the meantime, I use binkconv.exe (Search for "Bink" on Google, download, install, and copy binkconv.exe & radutil.dll to your program's directory) to convert images - it could also resize them with high-quality. Here's the function source code (it requires binkconv.exe and ratutil.dll in the program's directory):



Bink is free to download and distribute, but your program should display the bink logo somewhere. For more information, see the Bink website.

I've tried all the image conversion tools I could find, and however odd it is to call an exe file, it seems to work the best so far.

It'd be nice to have the full range of files in ImageMagick supported and in dlls (rather than akward exes), though.

-Xol

Ric
19
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 23rd Jul 2007 03:21
Good info, Xol. Certainly looks useful until an Imagemagick wrapper materialises. Does it do the conversion without opening any horrible dos prompt windows? Imagemagick can be run by command line too, but I couldn't find a way to hide the dos window.

Xolatron
18
Years of Service
User Offline
Joined: 12th Mar 2006
Location: The Star Forge Language: DBpro
Posted: 23rd Jul 2007 22:49
I've never gotten a DOS window using DBpro's "execute file" command, but that code uses a ShellExecuteA call to shell32.dll and tells it to suppress any pop-up windows, so it should be fine.

Perhaps replacing 'execute file' with this would help:


The 0 parameter at the end of the call tells shell32 to make the call invisible. The mouse sometimes turns into a half-timer (both pointer and timer - I don't know how else to describe it), though.

I'm interested to know why a DOS window appears when you normally call ImageMagick from the command line, since 'execute file' works without any console window for me - the exe specified simply runs as usual. Does this problem happen if you try to execute notepad.exe from DBpro, for example?

I resorted to the shell32 call above because the Bink Converter usually brings up a progress window (but for images this is so fast it's useless). The "/#" parameter allows this console to disappear without user input, so it doesn't invisibly slow down the CPU either.

-Xol

Ric
19
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 24th Jul 2007 00:05
Quote: "I'm interested to know why a DOS window appears when you normally call ImageMagick from the command line, since 'execute file' works without any console window for me - the exe specified simply runs as usual. Does this problem happen if you try to execute notepad.exe from DBpro, for example?"


No - it seems to be specific to Imagemagick - I don't know why, I think it's just designed that way. I'll try your alternative using shell execute - that may work out better. Still no substitute for a proper dbpro interface, though.

jinzai
17
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 27th Jul 2007 04:29 Edited at: 27th Jul 2007 04:30
IanM - well, I am working with it. I think that is a great idea...I much prefer static linking for this type of thing. I D/L'ed all the source, as well. that was alot of downloading! Certainly, any other thoughts that occur to you would be most welcome. Right now, I am using a thin wrapper class that uses STL vectors. It works well so far. I hope that I can post something soon. We can discuss why its crap then, and fix it!

...and I am on a somewhat coerced holiday in St. Louis right now. I brought the machine, but...haven't gotten 'tound to setting it up here...perhaps tomorrow - still sightseeing...St. Louis is a great midwestern city!
jinzai
17
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 2nd Aug 2007 12:07
Okay, I have the 21 projects running along in lockstep. The ImageMagick Windows source is unevenly documented, but fortunately it is so over-complete that I was able to wrestle it into my way of doing things; so far, so good. A few notes to anyone else wanting to work this way...you have to do a couple of things to create proper libraries for use in the DBPro DLL project. First of all, in the ImageMagick configure project, you must edit magick-config.h.in and #undef ProvideDllMain. The project you want to configure is VisualStaticMTDLL. In addition to that, you will want to manually edit every library project and specifically ignore the libraries msvcprt.lib and libcmt.lib. (You can right click in the Solution Explorer window and select the menu item Properties. You set the option on the Librarian tab, under the item Ignore Specific Library.) Now, after that, I move the built libraries up into a folder I created called lib, in the folder ImageMagick-6.3.5 I set my library search path to that in VisualC++, and list the libraries as additional dependencies, and copied the directory structure and include files to my plug-in project directory. Clear as mud, but it works alright for me. There is some include file editing necessary get it all working properly, but this way I can just create one DLL that includes all 19 ImageMagick DLLs as static code and has but one interface to DBPro. That is the idea, anyway. I only have the CoderInfo class working right now because I took my sweet time about getting the toolchain set up on this one. Too many side issues! I had to fix .NET, and that was a chore, but my system is much more stable now. Oh, and yes, I'm still on vacation, as well.

Perhaps I will post up something more specific, if anyone is interested in seeing my project files...they are VisualC++.NET 2003 based, but...I think they would work in VisualC++.NET 2005, as well. The ImageMagick source is in the file ImageMagick-windows.zip. After you unzip it, you go to the VisualMagick/configure directory, and open the configure project. VS will want to convert the projects, which is okay. This program, once built will make the project files for building the ImageMagick libraries. You configure the project, then open it and clean/make all. There is documentation on this process, but it has the usual Unix/Linux bias, so there are some things that are necessary, but not documented, like I stated above. I am not at all certain that I have found every issue as yet, either.
Ric
19
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 2nd Aug 2007 15:26
Wow, sounds like a lot of work. Hope you're still enjoying your vacation! Once completed, then, will this just be one dll which goes into the plugin directory? Or will there be a requirement to install additional libraries onto the end users machine, in order to distribute a dbpro exe that uses the plugin?

Let me know if I can help out in anyway (eg. documentation?)

MikeS
Retired Moderator
21
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 3rd Aug 2007 00:25
Just wanted to drop by and offer my few word of encouragement. This certainly looks like an excellent and very useful project. Keep up the great work!



A book? I hate book. Book is stupid.
(Formerly Yellow)
jinzai
17
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 3rd Aug 2007 01:54 Edited at: 3rd Aug 2007 02:06
Yes, it will be a single DLL with no external dependencies. At first, I thought it might be necessary to distribute X11 DLLs, but they are included in the library source. Then, I was not sure which static library to build/use. In determining the proper build, I came across the other issues I mentioned above.

It isn't much work at this point - I am just having the same slow time remembering how we do this sort of thing - combine third party library code with my code to present to the first (or is it second) party? In a DLL, noless. Today, I provided the basic constructors for images and blobs, and discovered that TGA is multiframe, and AVI is not writable from ImageMagick. Not surprising, either one.

btw, my answer to the why use a DOS window question is that all of the prebuilt utilities are console projects. My opinion is that this is the same leaning towards Unix/Linux that Open Source multi-platform projects seem to do. There are some other projects included in the Windows source that are not console projects...they are Windows apps. C++ sample and teaching code usually uses this programming method (a DOS, or console window) because it seems simple to the person writing it. True, but...I never liked it, either.

...and yes, the vacation is going well still.
Vidiot
17
Years of Service
User Offline
Joined: 15th May 2006
Location: TN
Posted: 5th Sep 2007 04:02
Not to pester, but... Is there anything to test yet?

Or did you all move to a new thread?

The answer to Life, the Universe, and Everything? "Tea for Two". Deep Thought was Dyslexic.
jinzai
17
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 30th Sep 2007 00:10
My bad guys. Yes, there is a pretty complete DLL which I will try to get posted today, or Monday at the latest. Alot is done, and I have documentation, too.

Sorry about the delay, I got moved out of my place and still don't heve my belongings back. Might have to get Judge Joe Brown on this one!
Ric
19
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 30th Sep 2007 15:18
Look forward to seeing what you've done Jinzai. No need for apologies - you're doing the work for this voluntarily, so it takes however long it takes. Hope you get your possessions back as soon as possible - sounds pretty awful!

Vidiot
17
Years of Service
User Offline
Joined: 15th May 2006
Location: TN
Posted: 26th Oct 2007 17:18
Knock, knock... (creeeeeeeeeeek)

Hello? Is anyone in there?

There's dust on all these posts. And WW Webs on all the routers... I'm scared!

LOL. Sorry for the bad humor but I do actually have a question if this DLL is ever completed. Did someone mension this .dll was already "open source"? And does that affect my ability to use a function from it in a application that I intend to sell?

@Jinzai, I wish there was a way I could help!

The answer to Life, the Universe, and Everything? "Tea for Two". Deep Thought was Dyslexic.
jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 26th Oct 2007 22:50
I THINK you can sell stuff that uses it - but in many of the licesne I know of for opensource - you must make the changes to the code that you did available. Not the code to your game - but the changes to the lib to make it work for ya. They're all different though - but that's usually how it goes.

jinzai
17
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 14th Nov 2007 22:34 Edited at: 14th Nov 2007 22:39
...okay, here it is FINALLY. Sorry again.

There is no alpha yet, and the Drawable class is not totally there, but you can do some neat stuff with it.

The file is a zip of the directory structure with the Dark BASIC Pro directory being the root. There is a sample project (yes, it totally stinks, but....) and also help and keywords. Thanks to Ric and Benjamin for the examples to follow.

Cheers, I hope its useful. Also, I hope to get back online soon. Right now, I am staying with #3 and #1 sons. Its been great, but no Internet.

Attachments

Login to view attachments
Ric
19
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 15th Nov 2007 02:36
Fantastic!! I will check it out as soon as I get back to my dev machine tomorrow - I can't wait to try it.

jinzai
17
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 15th Nov 2007 17:05 Edited at: 15th Nov 2007 17:06
Would someone try this so I can start on fixes that might be needed?

EDIT: Great...I posted on the page break. Go to my last post for the download. T H A N K S.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 15th Nov 2007 17:58
I will definitely be trying this out, as you know I've asked for this many times in the past.

tschwarz
19
Years of Service
User Offline
Joined: 13th Feb 2005
Location: 127.0.0.1
Posted: 15th Nov 2007 19:24
The sample worked without problems, I'll play around with it more this weekend. - Thanks this is going to be very useful.
jinzai
17
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 15th Nov 2007 22:15
Thanks so much tschwarz...I really needed to know that. You see, I'm using the Internet at work, and...well, I don't like doing it this way, but...it works for now. btw, there was a bit at the end (before) that created a GIF animation, but it was 20MB, so I decided to cut it out, but...ImageMagick can make 'tween frames, which is great.

Yes, it is pretty large with about 500 functions, or so. I will look here again tomorrow morning...I'm US Central Time...in IOWA now!
Ric
19
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 16th Nov 2007 02:55
Wow!!!!! This is brilliant. The included project example works fine here - and fast, too. I am just beginning to play around with things - there is a huge amount of info to absorb - but I am really amazed at what this can do, and what you have given this community. I hope lots of people take advantage of this plugin and have a play with it, because freebies like this don't come around very often.

aluseus GOD
17
Years of Service
User Offline
Joined: 19th Mar 2007
Location: I\'m here. Now I\'m there. I keep moving
Posted: 16th Nov 2007 03:46
i;d give you the full version of visual studio , but that would break the EULA (I dont care a lot but im sure you would.)

alus.portbb.com go there.
[quote]A book. I hate books. book is stupid. I know that I need codes but I dont know the codes.[/quote} -zenicanin14 the stupidest user in the world.
Vidiot
17
Years of Service
User Offline
Joined: 15th May 2006
Location: TN
Posted: 16th Nov 2007 05:34
Yeah!!!!!!!!!!!!! I will be trying it out tomorrow...

The answer to Life, the Universe, and Everything? "Tea for Two". Deep Thought was Dyslexic.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 16th Nov 2007 10:18
I ran the example last night and saw that it was good

Now I need to find time to absorb all the info, as Ric says it's damn good, and very comprehensive.

Some points to consider:

Demo code
1. keyword TRUE only works in the default editor. I replaced it with -1, I don't know if this is correct.

2. The ... concatenation of lines is also a default editor thing, if you hit this just glue the lines back together and it will be fine.

Delivery
Something is very strange here. You unzip it and everything is in the right place. It comes with help files and demo code. This is highly unorthodox, usually a TPC involves huge amounts of stress and grinding of teeth to find teh codez.

jinzai
17
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 16th Nov 2007 17:58
Thanks guys...I appreciate the comments. Most of the brilliance is at ImageMagick, however.

I thought I had used a #constant for TRUE; it is supposed to be 1, and only 1. I use -1 to return failure of the ImageMagick API code...it will throw a C++ exception sometimes. (Even if things are okay, like in AnnotateImage.)

As for the concatenation...I just like readable code, and I'm old, so you will see that all over my code. Sorry.

Yes, ain't that a hoot. If I could've made it self-extracting, I would have. (It isn't hard to find out where DBPro lives from the registry.)
Vidiot
17
Years of Service
User Offline
Joined: 15th May 2006
Location: TN
Posted: 21st Nov 2007 05:06 Edited at: 21st Nov 2007 05:18
Ok, so here's my first attempt to get a file into and out of Image majick. The only problem is I'm loosing part of the image. So far as I can tell, the output file should be exactly like the input file except form the Image flip.

According to windows properties dialog, it is the same size as the original, but the image is still missing a part. It also seems to be a little bit zoomed.





So if you can spot a problem with this, speak up. Also, it appears like I have to know the geometry of an image before I can open it. Is that correct? That why I tried the Memblock method becasue at least from there, I could get dinmensions.

The answer to Life, the Universe, and Everything? "Tea for Two". Deep Thought was Dyslexic.

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-04-25 08:32:35
Your offset time is: 2024-04-25 08:32:35