HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

ImageUtils

09-18-2009, 06:26 PM#1
Deaod
Well, purpose of this library:
- add the IMAGE_TYPEs Blizzard forgot to add.
- provide an object oriented wrapper for images + some additional features, like reading certain properties of the image

Images are an interesting type. I recently published a documentation of that type, which is also the basis for large parts of this script.

This library uses vJass (JassHelper 0.9.H.0 and up) and ARGB.

Expand ImageUtils:

EDIT 1: Updated ImageUtils to incorporate the result of my research. Attached a map demonstrating use of ImageUtils in the context of a TextSplat library.
EDIT 2: Added a documentation. If you still need something explained, feel free to ask.
EDIT 3: Made the link to my research more visible.
EDIT 4: Fixed two bugs.
EDIT 5: Now supports wrapping to the ground. Fixed documentation errors.
EDIT 6: Updated with workarounds to the newfound bug. As a result, CreateImageEx was added. Refer to the documentation for more information.
EDIT 7: Deprecated CreateImageEx in favour of NewImage/ReleaseImage. Now also tries to work around the most common errors with images (and reports those to the user).
EDIT 8: Fixed imagex instances causing errors.
09-18-2009, 06:34 PM#2
Rising_Dusk
Expand JASS:
Man, fix the bloody spacing... Also, did you verify that this is actually the order (from bottommost to topmost) that Blizzard uses in actual WC3 or are these the (obviously incorrect) names used in GUI?
Expand JASS:
Use SCOPE_PREFIX.

Oh, and put the "ImageUtils" library on top of the example, and have both of them use [hiddenjass][/hiddenjass] tags around them.

You will also need better documentation. By a lot.

Also, I am calling forth the necessity of a demo map for this library. I refuse to let it get approved without one that shows all of the working image types, how they stack on each other, and gives some examples of how they work when you change their values and such.
09-22-2009, 10:35 PM#3
Deaod
Updated.
09-23-2009, 01:45 PM#4
Rising_Dusk
Quote:
Originally Posted by Rising_Dusk
You will also need better documentation. By a lot.
Collapse JASS:
    // Credits:
    // - Vexorian for ARGB and JassHelper
    // - Pipedream for grimoire
    // - MindWorX and Pitzermike for JassNewGenPack
    // - SFilip for TESH
This does not constitute proper script documentation. Parts of your image test experiment thing will basically need to be copied and pasted into the library to explain why the library does what it does and how it does it.
10-08-2009, 02:31 PM#5
Rising_Dusk
Please do something about your documentation so I can approve this.
10-16-2009, 12:01 PM#6
Deaod
Is that enough documentation now?
10-16-2009, 01:44 PM#7
Rising_Dusk
I think it's enough, but I suggest having the URL for your Image Tutorial in the documentation too for further reading if the user is interested.
10-16-2009, 02:49 PM#8
Deaod
Link was already there, but anyway, updated.
10-16-2009, 03:20 PM#9
Rising_Dusk
Oh? I guess I missed it when I read it, weird. Oh well, approved.
11-08-2009, 04:25 AM#10
Deaod
updated.
11-15-2009, 10:21 PM#11
Deaod
Aaaaand, updated.
11-26-2009, 12:37 AM#12
Rikim4ru
It's annoying that the position is always the lower left corner of the image. You can fix that 'flaw' with simple math. Could you please do that?
11-26-2009, 02:37 PM#13
Deaod
I wont "fix" that, mostly because i already have two other libraries depending on it.
Also, its rather trivial to fix this on your side (or even incorporate it).

Edit: That aside, where would you want me to move the origin to?
11-26-2009, 02:51 PM#14
Viikuna-
It could be in the middle of the image, so when modifying its size over time, you dont have to move your image alla time.

See for example those images that appear in the ground when you use burrow/unborrow spell with those undead nerubian units.
11-26-2009, 03:24 PM#15
Rising_Dusk
The origin being the center does make the most sense, for what it's worth.