Distros > Icaros Desktop

Not-so-poor Icon processor

(1/9) > >>

miker1264:
I saw the post about the "Not-so-poor Icon processor" built in LUA and I'm very impressed by that concept.

I have been working on something similar called "Icon Factory" that only works on one png icon at a time.
If the Icon Processor can create multiple icons from icon images that is a win-win for Icaros Desktop.

I already have c code for combining image1 and image2. It's very simplistic based on two small functions.
So here it is:


//Save image1
//Simply Copy first Icon Image to new filename.
copy_file("Ram Disk:Im1.dat", fileName);
                               
//Save image2
//Simply append image2 on top of image1.
copy_file_append("Ram Disk:Im2.dat", fileName); 
//Substitute the name of your image1 & image2 for the ones above.
//In this case "fileName" is the .info file to save images to.
//Note that the original images must be in png image format.

                               
int copy_file(char *old_filename, char  *new_filename)
{
      FILE  *ptr_old, *ptr_new;
      int  a;

      ptr_old = fopen(old_filename, "rb");
      ptr_new = fopen(new_filename, "wb");

      while(1)
      {
         a  =  fgetc(ptr_old);
         if(!feof(ptr_old))
            fputc(a, ptr_new);
         else
            break;
      }

      fclose(ptr_new);
      fclose(ptr_old);
      return  0;
}

int copy_file_append(char *old_filename, char  *new_filename)
{
      FILE  *ptr_old, *ptr_new;
      int  a;

      ptr_old = fopen(old_filename, "rb");
      ptr_new = fopen(new_filename, "a");

      while(1)
      {
         a  =  fgetc(ptr_old);
         if(!feof(ptr_old))
            fputc(a, ptr_new);
         else
            break;
      }

      fclose(ptr_new);
      fclose(ptr_old);
      return  0;
}


miker1264:
Here is the article to refer to:
http://vmwaros.blogspot.com/2019/08/not-so-poor-icon-processor.html

I like the gui layout to the left, but I think I'm most impressed by the Picture Requester on the right side.
Is that available in Icaros Desktop now? I'd like to use that in some of my programs. That's a nice feature!

salvatore:
I don't know, maybe you should talk to Paolone

paolone:

--- Quote from: miker1264 on August 26, 2019, 01:53:31 AM ---Here is the article to refer to:
http://vmwaros.blogspot.com/2019/08/not-so-poor-icon-processor.html

I like the gui layout to the left, but I think I'm most impressed by the Picture Requester on the right side.
Is that available in Icaros Desktop now? I'd like to use that in some of my programs. That's a nice feature!

--- End quote ---
Yes. That's the great PictureReq from Yannick Erb. You can find it in /C.

Syntax is
picturereq PATH PATTERN
for instance, to open PNG files only in Home:
picturereq home: #?.png
ask yannick for the complete documentation, or look at the code, is open-source.

miker1264:
paolone,
Thank you for the information.

I really like the idea of the Iconposer App.
If you add a couple of buttons for "Create" and
"Assign" just above "Cancel" it would be very
efficient and very useful.

Create will simply create the icon but Assign
would use a file requester to assign the icon to a file. If the file already has an icon associated it becomes an icon exchage operation.

Then adding "Create Icon" to the Magellan Menu
Could make it a very useful icon creation tool.

Just some ideas. Very good work so far.

Navigation

[0] Message Index

[#] Next page

Go to full version