Wanderer Icon Exchange

miker1264 · 18432

Amiwell

  • Legendary Member
  • *****
    • Posts: 2616
    • Karma: +35/-4
  • Peace
Reply #45 on: December 17, 2021, 06:46:52 AM
nice Miker :)



ilBarbax

  • Newbie
  • *
    • Posts: 14
    • Karma: +2/-0
Reply #46 on: December 17, 2021, 11:51:44 AM
After some experimentation I've concluded that the Icon Information window is not the best place for Icon Exchange.

Rather I would propose a new Icon Exchange Module to exchange icon images. The new icon can then be opened in Icon Information to change ToolTypes, etc.

Drag icon on the information window under os4 is quite easy and functional. I like it.



AMIGASYSTEM

  • Global Moderator
  • Legendary Member
  • *****
    • Posts: 3744
    • Karma: +69/-2
  • AROS One
    • AROS One
Reply #47 on: December 17, 2021, 12:29:50 PM
Drag icon on the information window under os4 is quite easy and functional. I like it.

The information window under os4 OS4.1 is the same as that of OS 3.5/9, OS 3.1.4/3.2, but also OS 3.1 if you use an external program.

This mode is good if you have to change an icon every now and then, if you have to change many icons you need a small utility where dragging allows you to change many icons in a few seconds, i enclose video exhaustive

https://drive.google.com/file/d/1k8pOKVu4-Azuqx-AneGgbe2SfFWFEjai/view?usp=sharing


miker1264

  • Legendary Member
  • *****
    • Posts: 1827
    • Karma: +84/-6
Reply #48 on: December 17, 2021, 05:53:20 PM
I've began writing an Icon Exchange App based on GadTools.

I may decide to leave Icon Information alone. It just needs a way to change Icon Type. But if it isn't broken. Don't try to fix it.  ;)

This app is called "IconClone". It's a very simple design much like CopyIcon. The image on the left is "old icon". The image on right is "new icon". Select icon files with the two '?' Selector Buttons. The Double-Arrow Button performs the Icon Exchange.

Maybe in the future IconClone may have a small menu system. You may expect several more of these small icon applications.

Hopefully it will also allow Drag-n-Drop for quick selection and processing if you have several icons to process at a time.  8)

GadTools is much easier for me than trying to learn MUI/Zune.
« Last Edit: December 17, 2021, 06:07:16 PM by miker1264 »



AMIGASYSTEM

  • Global Moderator
  • Legendary Member
  • *****
    • Posts: 3744
    • Karma: +69/-2
  • AROS One
    • AROS One
Reply #49 on: December 18, 2021, 01:41:27 AM
Great, if you've watched the whole of the attached above video, at the end of the video it shows the little App to change the Drawer, Poject, Tool etc. icon type on the fly.


miker1264

  • Legendary Member
  • *****
    • Posts: 1827
    • Karma: +84/-6
Reply #50 on: December 18, 2021, 01:58:49 AM
Great, if you've watched the whole of the attached above video, at the end of the video it shows the little App to change the Drawer, Poject, Tool etc. icon type on the fly.

Interesting. So for simplicity we don't need "Save" & "Exit" Buttons. Save is "Exchange = <->" and Exit is the Close Gadget. Nice.

So the image on the left is "Source" and we drop or select the image on the right ("Desitination") then choose "Exchange".

Once you drop or select the source icon it becomes a two-step conversion process. Drop or select destination then choose "<->" to exchange. Then repeat...



AMIGASYSTEM

  • Global Moderator
  • Legendary Member
  • *****
    • Posts: 3744
    • Karma: +69/-2
  • AROS One
    • AROS One
Reply #51 on: December 18, 2021, 02:21:03 AM
Yes, unfortunately also the two Icontype OS3 versions don't work with the native AROS x86 icon.library.

As said it's good to have these tools also on Wanderer, the Apps as shown in the video are for multiple changes on a number of icons.


miker1264

  • Legendary Member
  • *****
    • Posts: 1827
    • Karma: +84/-6
Reply #52 on: December 18, 2021, 02:31:11 AM
Yes, unfortunately also the two Icontype OS3 versions don't work with the native AROS x86 icon.library.

As said it's good to have these tools also on Wanderer, the Apps as shown in the video are for multiple changes on a number of icons.

I will continue to work with Icon Exchange in Wanderer Icon Information because it's convenient to do it there for exchanging images.

Send me samples of the OS3 icons that don't work or post them here. I''ll investigate.

Meanwhile, the IconClone Project GUI is going from Concept to Real Application.  :)

I must first center the three buttons in the middle of the window which involves adjusting origin & coordinates. Then I must draw three Bevel Boxes.The Bevel Boxes are simply three dimensional "frames" which are drawn on the RasterPort. The outer "group box" is a "sunken" Bevel Box". The two inner Raised Panels for Icon Image display are "Raised" Bevel Boxes. The four corners of each Raised Panel represents the drop zone coordinates.

After drawing the Bevel Boxes I can remove the Save & Exit buttons that are just place hoders at the moment. Then the GUI design is complete!  :)

« Last Edit: December 18, 2021, 03:48:10 AM by miker1264 »



Amiwell

  • Legendary Member
  • *****
    • Posts: 2616
    • Karma: +35/-4
  • Peace
Reply #53 on: December 18, 2021, 05:51:19 AM
great Miker :D



AMIGASYSTEM

  • Global Moderator
  • Legendary Member
  • *****
    • Posts: 3744
    • Karma: +69/-2
  • AROS One
    • AROS One
Reply #54 on: December 18, 2021, 06:27:07 AM

Send me samples of the OS3 icons that don't work or post them here. I''ll investigate.


Miker are the normal DualPNG icons that I use on AROS One x86/68k, CopyIcon and IconType "do not work" on AROS 68k only if I use the native "AROS Icon.library".

If I use PeterK Icon.library no problem, all CopyIcon and IconType apps work perfectly.


miker1264

  • Legendary Member
  • *****
    • Posts: 1827
    • Karma: +84/-6
Reply #55 on: December 18, 2021, 05:35:48 PM
Here is the actual IconClone application in action.  8)

Currently we have to use the requester buttons [ '?' ]. But in the near future we can use Drag-n-Drop!

It's the AROS equivalent of CopyIcon but only better because we can use IconClone on all AROS flavors.

This GUI only has three buttons! Notice the Bevel Boxes, sunken & raised, which are drawn on the RasterPort.
« Last Edit: December 18, 2021, 08:24:20 PM by miker1264 »



miker1264

  • Legendary Member
  • *****
    • Posts: 1827
    • Karma: +84/-6
Reply #56 on: December 18, 2021, 05:42:59 PM
Each Raised Panel for Icon Image Display is 80x80 pixels.

Some fancy code to center the icon images since image size can vary.

   BOOL retval = FALSE;
   UWORD srce_x,srce_y;
   UWORD center_x,center_y;
   int width,height,depth;
   RGBImage *in_pic = NULL;
   struct BitMapHeader *bmhd;

   Printf ("ReadBmhd_by_datatype");
   bmhd = readbmhd_by_datatype(srcename);
   width = bmhd->bmh_Width;
   height = bmhd->bmh_Height;
   depth = bmhd->bmh_Depth;   

   /* Centered = width,height/2 */
   center_x = ((80-width)/2);
   center_y = ((80-height)/2);

    /* Get RasterPort coordinates */      
   if(stricmp(position,"left") == 0)
   {
      /* Top left of First Raised Panel */
       srce_x = 26 + center_x;
       srce_y = 25 + topoffset + center_y;
   }
   if(stricmp(position,"right") == 0)
   {
      /* Top left of Second Raised Panel */
       srce_x = 151 + center_x;
       srce_y = 25 + topoffset + center_y;
   }



AMIGASYSTEM

  • Global Moderator
  • Legendary Member
  • *****
    • Posts: 3744
    • Karma: +69/-2
  • AROS One
    • AROS One
Reply #57 on: December 19, 2021, 01:16:31 AM
Great miker, on AROS x86 will be fantastic since there are no similar programs


Amiwell

  • Legendary Member
  • *****
    • Posts: 2616
    • Karma: +35/-4
  • Peace
Reply #58 on: December 19, 2021, 04:56:42 AM
Yes great miker :)



cdimauro

  • Member
  • ***
    • Posts: 164
    • Karma: +26/-1
Reply #59 on: December 19, 2021, 07:46:03 AM
Each Raised Panel for Icon Image Display is 80x80 pixels.

Some fancy code to center the icon images since image size can vary.

   BOOL retval = FALSE;
   UWORD srce_x,srce_y;
   UWORD center_x,center_y;
   int width,height,depth;
   RGBImage *in_pic = NULL;
   struct BitMapHeader *bmhd;

   Printf ("ReadBmhd_by_datatype");
   bmhd = readbmhd_by_datatype(srcename);
   width = bmhd->bmh_Width;
   height = bmhd->bmh_Height;
   depth = bmhd->bmh_Depth;   

   /* Centered = width,height/2 */
   center_x = ((80-width)/2);
   center_y = ((80-height)/2);

    /* Get RasterPort coordinates */     
   if(stricmp(position,"left") == 0)
   {
      /* Top left of First Raised Panel */
       srce_x = 26 + center_x;
       srce_y = 25 + topoffset + center_y;
   }
   if(stricmp(position,"right") == 0)
   {
      /* Top left of Second Raised Panel */
       srce_x = 151 + center_x;
       srce_y = 25 + topoffset + center_y;
   }
A few suggestions about the above code:


1) add spaces after the comma, when there's a list of variables. For example:
UWORD srce_x, srce_y;
it makes the code more readable.


2) don't hard-code values on things that might change (e.g.: icons/regions dimensions). Better to define constants for such values;


3) the second if could be better optimized adding an else in front:
else if(stricmp(position,"right") == 0)


this avoids checking again the string when it was already sure that it was left.