Icon Editor - COMPETITION TIME

RandomCoder

Well-Known Member
Licensed User
Longtime User
Please see this thread for where the idea has come from and some links to other sites detailing the format of an icon file http://www.b4x.com/forum/showthread.php?t=580

I'm going to need some help to set this in motion because I don't fully understand what is required myself :confused:

It looks like we need to program an editor that is capable of drawing/modifying two or three different size icons namely 16x16, 32x32 and 48x48 with a standard set of colours.
There is then also two layers that are required, the AND and the XOR mask. From what I can understand this is to do with transparency.
Once the image has been created we then need to save it to a file that is correctly formatted to be recognized as a valid Icon file (which interestingly can contain more than one image). A good example of an icon file with several images included is the WiFi icon on your device!!!!

Who's up for the challenge?
Can anyone shed some more light on what we actually need to do to make this work?
I've got to admit that creating the designer I think should be easy enough but I've had very little involvement with creating files so that will be my biggest hurdle :sign0148:

Regards,
RandomCoder
 

Stellaferox

Active Member
Licensed User
I think that is a very good start with equal opportunities for everyone. RandomCoder, I think you pretty much covered the needs so far. SAVE and LOAD-features.
I suggest after the competition we pick a winner and that program will be standardized with features that are well thought of from the other candidates. This program can be built up as "our" very own editor and put on the net.
What say you....?:sign0060:
 

RandomCoder

Well-Known Member
Licensed User
Longtime User
I love the idea :sign0060:

But do we need a more clearly defined structure?

I also think that one month (just four weeks) is possibly a too restrictive timescale for most people given the level of work and research that is required.
Would it be better to say two months?
For those of us in the UK, this pretty much coincides with the childrens school hildays and so I guess that some people will be busy with holidays whilst others maybe enjoying some extra free time.

I really like the idea and I'm well up for it but I'm just a little afraid that I will not be able to make proper sense of the file handling side of things.
But at least I should learn a lot from this :)

Regards,
RandomCoder.
 

Cableguy

Expert
Licensed User
Longtime User
I tryed the sample app and I can't see an icon image, in whatever size I choose!!
 

RandomCoder

Well-Known Member
Licensed User
Longtime User
I just located an icon file in the windows directory, haven't tried it on the device yet. I know that the WiFi icon is a good icon to chose.

Got to admit that I got several errors when trying different files and different size icons but you have to accept that it was very good of Erel to demonstrate how it should work.

Regards,
RandomCoder.
 

RandomCoder

Well-Known Member
Licensed User
Longtime User
Has anyone tried doing anything with this yet????

Its really, really difficult :(

I'm trying to create the designer.
First of all I started by using Buttons set in a 32x32 grid but that took WAY too long to load. I then thought that I could use Labels instead but this took just as long.
I've now worked around the problem by drawing directly on the form (don't want to give too much away ;) ), but now my next problem is finding a source that lists the standard device colours.
I want to create the pallete and need to set the correct RGB values. Can anyone point me in the direction of a good source of information :sign0085:

Regards,
RandomCoder
 

Erel

B4X founder
Staff member
Licensed User
Longtime User

Attachments

  • Colors.txt
    2.5 KB · Views: 308

RandomCoder

Well-Known Member
Licensed User
Longtime User
I've created the pallete using a For loop and was hoping to assign the colours using a kind of algorithm. Then when a Button is pressed I just grab the Color assigned to it and use that to draw with.

Have you any other suggestions as to how I can program around this?
I'm really pleased with the editor, I've got it running pretty quick now.

Regards,
RandomCoder
 

RandomCoder

Well-Known Member
Licensed User
Longtime User
I don't think that creating 256 buttons for the colors is the best solution.

Neither do I, especially after seeing how long it took to place 1024 in a 32x32 grid :sign0161:

My idea was to have 48 buttons at the bottom of the screen that show a range of colour in a set band i.e. reds, yellows, blues and greens etc, selected by a tab like control.

I have to admit that I'm learning by trial and error, and this seems to be particularly challenging.
I'm sure that my original suggestion of a calculator would have been far easier ;)

I'll PM you my code so that you can see what I'm on with. At the moment there isn't very much as I'm trying to keep it as compact as I can. It's also been done on the device and so as usual I'm finding that it doesn't display or work exactly the same on the desktop. The grid is slightly out of position to the pen marks and I'm using a MouseMove event, which on the Device works perfectly, but on the desktop it causes the pen to draw even when not holding the mouse button down.

Regards,
RandomCoder
 

RandomCoder

Well-Known Member
Licensed User
Longtime User
After further investigation it would appear that I don't actually need to use a 'standard' palette since the colours are stored within the Icon file, and presumably any no-standard colours will be replaced by the closest device colour.

Is their anyone else attempting their own icon editor :confused:
I haven't even got to the reading/writing to file stuff yet and am already struggling :sign0148:

Regards,
RandomCoder
 

Cableguy

Expert
Licensed User
Longtime User
Well, I started mine, using the "picturebox as a pixel" aproach, wich is quite slow even if we use the IDE to place the controls....To Ease things up a bit I created an "control array creator" in wich I placed the nr of row and colums and the size of the control and gap between controls, and the "addcontrol" was added to a file in IDE format, so I just neede to copy its content to the project sbp file using a text editor....

For the colors I was planning on using a 3 slider solucion, and after a quick search, i founsd out that a 256 palette is a "normal" palette but with a 51 (or 52, not sure)bit separation of colors, so should be too hard to implement...

As you say, an ico file also stores the color palette, but when creating a new icon, there iss no color palette defined, so keep that aalso in mind, you will need to generate the palette...

Unfortunatly, and thankfully, due to my new job :)sign0060: ) I now don't have as much free time as I did...So probably won't be able to enter the compettition...

Maybe the next one....
 

Cableguy

Expert
Licensed User
Longtime User
The competion Idea is a great one...
But perhaps we started a too big project for us...???

Still I'm up for the chalange And would like to see some question answered before start (Have we started already??).

WIch platform to target:
Device only, Desktop only, Both?

Icon sizes:
16x16, 32x32 and 64x64?
256 colors only palette?

File types:
ico and dll, or just ico?

What primall funcions?

Load, save?

What grafical primall funcions.
pixel, line, elispe,fill, erase....

DLL's

Use them or not?


Please create a fixed must have funcions before start, in order to set the dificulty to equal levels to every-one....

As someone posted, if it works, it's a winner...

And Please do set a start date and a finish date...
 

RandomCoder

Well-Known Member
Licensed User
Longtime User
To be honest I classed the posting of this thread as the start of the challenge (note that I used the word challenge instead of competition because I think most of us will find this so challenging that we'll just be glad to get something working irrespective of the competition ;) )

But to answer your questions and put as much 'meat on the bone' as possible...

Target is both the desktop and device, although the device is more favourable as it was a question relating to icon editors on the device that started all of this off.

Icon Sizes 16x16 and 32x32 only with up to 256 colours.

File type, must be .ico but if you can work out how to include .dll or .exe then these can also be included.

The primal functions I had in mind were, create new, load, edit, save and saveas.

Graphical functions... As many as you like - I didn't realise how hard it was to create many of these and at present only have a simple pen option but hope to expand on this.

Dll's, why not although this could be deemed as an unfair advantage but if you have the know how them why not use it :sign0188:

The difficulty I think is set high enough just trying to get something that will work. The more features you want to add the harder it obviously gets.

I'm sure that once you get started you'll soon discover just how tricky this application really is. I was struggling just to get a grid to create the icon on and then to extract the design from.

Start date is NOW...
End date is end of September (If that's OK with everyone else - although I think that there's only myself that's actually having a go at it, but Erel has suggested that he may come up with something :sign0060: )

Regards,
RandomCoder
 

Cableguy

Expert
Licensed User
Longtime User
Hi RandomCoder, long time, no see....:)

I found this litle dll that maybe can help in your/our quest for an icon editor...
 

RandomCoder

Well-Known Member
Licensed User
Longtime User
Hi RandomCoder, long time, no see....:)

I found this litle dll that maybe can help in your/our quest for an icon editor...

Thanks CableGuy,
Unfortunately I don't have any VB software and so cannot view the files. I've been keeping track of your own dll development and I have to say that its all a little over my head. Maybe one day I might try to understand dll creation and the syntax, but for now I'm more than happy playing with B4PPC.

PS this challenge is really tough, I'm not particularly making much headway with it.
 

Cableguy

Expert
Licensed User
Longtime User
Inside the zip bin's folder there's a compiled dll that can be used as a normal dll for basic4ppc....
 

RandomCoder

Well-Known Member
Licensed User
Longtime User
In one of the other threads I've already said that my icon editor is pretty pathetic, but here is the proof. (I'm not sure that I can actually call it an icon editor as all it is at the moment is a designer.)
I must apologise for not completing it further, today I have been to court to fight for the right to see my children and so have been very busy in the run up to this and it's been weighing heavy on my mind.

Why did I set such a difficult task :confused:

Maybe if I get the opportunity I will add some file handling.

Regards,
RandomCoder
 

Attachments

  • Icon Editor.zip
    3.1 KB · Views: 308
Top