Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
105 user(s) are online (62 user(s) are browsing Forums)

Members: 0
Guests: 105

more...

Headlines

 
  Register To Post  

Mouse pointer images
Just popping in
Just popping in


See User information
Are the mouse pointer images somewhere on disk or are they in Intuition itself? SYS:Prefs/Presets/Pointers are just the main pointer image.

I want to copy POINTERTYPE_TEXT and make a slight change to it and set the new image myself.

If it's on disk, can the Prefs->Pointer editor change them?

Go to top
Re: Mouse pointer images
Just popping in
Just popping in


See User information
Why does the Icon Editor not save correctly?!

Can someone make a working white (not black) version of:

def_textpointer.info


Please and thank you.

mritter0 at gamil.com


Edited by mritter0 on 2019/7/15 3:09:42
Workbench Explorer - A better way to browse drawers
Go to top
Re: Mouse pointer images
Home away from home
Home away from home


See User information
@mritter0

Based on your second question you probably already worked out that the default pointer images are in ENVARC:Sys/def_#?_pointer.info . I'll Just stated it explictly for anyone else reading ths thread who doesn't know.

Quote:

Why does the Icon Editor not save correctly?!


It does, it's just that it's definition of "correct" predates 32colour icons.

Use an image editor with 32bit support (I receomend SketchBlock )

Quote:

Can someone make a working white (not black) version of:

def_textpointer.info



You don't need and in fact I would recomend against using an icon for you custom pointers. Use images instead (see TBIMAGES:#?cursor)

Here are two candidates (with apologies to 'mason')
http://broadblues.f2s.com/textcursor_white_shadow.png
http://broadblues.f2s.com/textcursor_white.png




If you felt really clever you could split the cursor and shadow parts of the alpha channels and build your own in memory with custom colours for cursor and shadow to match any colour theme the user micght choose.

Go to top
Re: Mouse pointer images
Just can't stay away
Just can't stay away


See User information

Go to top
Re: Mouse pointer images
Just popping in
Just popping in


See User information
@broadblues

Just using an image makes more sense. I was getting to that point since I am just pulling the image out of the icon anyway....


@jabirulo

Thanks. Hopefully won't be needed.

Workbench Explorer - A better way to browse drawers
Go to top
Re: Mouse pointer images
Just popping in
Just popping in


See User information
I can't get anything except the original icon to load. I used the 32bit editor from above to change the color to white; just get a garbage pointer.

You can't use PNGs directly like you can with everything else (gadgets, menus, toolbars). It has to be a generic bitmap.

Is there anything wrong with this code that doesn't like editted icons?

Pulling my hair out (what's left of it).


SAK_LoadPointer((STRPTR)"PROGDIR:Images/def_textpointer",ActiveScreen);



struct DiskObject                   *SAK_MouseDiskObject=NULL;
Object                              *SAK_MousePointerObject=NULL;


VOID
SAK_LoadPointer
(STRPTR name,struct Screen *Scr)
{
    
uint8                            *image=0;
    
int32                            w=0h=0;
    
STRPTR                            xoffset_toolyoffset_tool;
    
int32                            xoffset=0yoffset=0;

    
SAK_MousePointerObject=NULL;

    if ((
SAK_MouseDiskObject=IIcon->GetIconTags(name,
        
ICONGETA_FailIfUnavailable,                TRUE,
    
TAG_DONE)))
    {
IDOS->Printf("1\n");
        
IIcon->LayoutIcon(SAK_MouseDiskObject,Scr,TAG_DONE);
        
IIcon->IconControl(SAK_MouseDiskObject,
            
ICONCTRLA_GetImageData1,                &image,
            
ICONCTRLA_GetWidth,                        &w,
            
ICONCTRLA_GetHeight,                    &h,
        
TAG_DONE);

        if ((
xoffset_tool=IIcon->FindToolType((SAK_MouseDiskObject)->do_ToolTypes,"XOFFSET")))
        {
            
xoffset=atoi(xoffset_tool);
        }

        if ((
yoffset_tool=IIcon->FindToolType((SAK_MouseDiskObject)->do_ToolTypes,"YOFFSET")))
        {
            
yoffset=atoi(yoffset_tool);
        }

        if (
image)
        {
IDOS->Printf("2\n");
            
SAK_MousePointerObject=IIntuition->NewObject(NULL,"pointerclass",
//                POINTERA_BitMap,                        fallbackPointer,
                
POINTERA_ImageData,                        image,
                
POINTERA_Width,                            w,
                
POINTERA_Height,                        h,
                
POINTERA_XOffset,                        -xoffset,
                
POINTERA_YOffset,                        -yoffset,
//      POINTERA_WordWidth,   (ULONG)(w+15)/16,
//      POINTERA_XResolution, (ULONG)POINTERXRESN_SCREENRES,
//      POINTERA_YResolution, (ULONG)POINTERYRESN_SCREENRESASPECT,
            
TAG_DONE);
        }
    }
}

Go to top
Re: Mouse pointer images
Home away from home
Home away from home


See User information
@mritter0

Quote:

You can't use PNGs directly like you can with everything else (gadgets, menus, toolbars).


You have to load them yourself with a datatype.
Quote:

It has to be a generic bitmap.


Er no it's 32bit ARGB data not a bitmap. That is what you extract from the icon.


//                POINTERA_BitMap,                        fallbackPointer,


You *must* provide this it cannot be commented out. Or the object wont be created

Quote:


POINTERA_ImageData (uint32 *) (V52)
Pointer to image data to reference pointer imagery from.
The format of the image data is direct mapped ARGB true
color.

The total number of bytes in the block of data must be
POINTERA_Width * POINTERA_Height * sizeof(uint32).

Note that POINTERA_BitMap, POINTERA_WordWidth,
POINTERA_XResolution and POINTERA_XResolution are still
required to store a backup image in case the destination
hardware cannot display true color pointers.

If no POINTERA_BitMap is provided the default pointer will
be used and the POINTERA_ImageData will be ignored.






Go to top
Re: Mouse pointer images
Home away from home
Home away from home


See User information
Here is my pointer loading code from SketchBlock.

static UWORD handdata[]=
{  
0x0400,0x0e00,0x0e00,0x0e00,0x0e00,0x0f80,0x0fe0,0x4ff8,
   
0xeff8,0x7ff8,0x3ff8,0x3ff8,0x1ff8,0x1ff8,0x0ff0,0x0ff0,

   
0x0400,0x0a00,0x0a00,0x0a00,0x0a00,0x0b80,0x0ae0,0x4ab8,
   
0xa828,0x5808,0x2808,0x2808,0x1008,0x1008,0x0810,0x0ff0
};

static 
struct BitMap fallback=
{  
2,16,0,2,0,{(PLANEPTR)handdata,(PLANEPTR)(handdata+16)}
};
/* Load and add a pointerclass application to the available list */

LONG AddApplicationPointer(struct SketchApp *skappSTRPTR tbimage,  WORD hotXWORD hotYSTRPTR name)
{
    
LONG result = -1;
    
struct SketchMousePointer smp NULL;
    if((
smp    Allocmem(sizeof(struct SketchMousePointer),MEMF_PRIVATE MEMF_CLEAR)))
    {
        
Object *dto IDataTypes->NewDTObject(tbimage,
                
DTA_SourceType,DTST_FILE,
                
DTA_GroupID,GID_PICTURE,
                
PDTA_DestMode,PMODE_V43,
                
TAG_DONE);

        if(
dto)
        {
            
            
struct pdtBlitPixelArray bpa;
            
struct BitMapHeader *bmhd;
            
UWORD w 0,h0;
    

    
            if(
IDataTypes->GetDTAttrs(dtoPDTA_BitMapHeader, &bmhdTAG_DONE))
            {
    
                
bmhd->bmh_Width;
                
bmhd->bmh_Height;
            }
            
smp->smp_X hotX;
            
smp->smp_Y hotY;
            
smp->smp_Width w;
            
smp->smp_Height h;
            
    
            if((
smp->smp_Buffer Allocmem(sizeof(ARGB32) * h,MEMF_CLEAR MEMF_SHARED)))
            {
                   
//IExec->AddHead((struct List *)&newprj->sp_Layers,(struct Node *)newlay);

                
bpa.MethodID PDTM_READPIXELARRAY;
    
                
bpa.pbpa_PixelData smp->smp_Buffer;
                
bpa.pbpa_PixelFormat PBPAFMT_ARGB;
                
bpa.pbpa_PixelArrayMod smp->smp_Width sizeof(ARGB32);
                
bpa.pbpa_Left 0;
                
bpa.pbpa_Top 0;
                
bpa.pbpa_Height smp->smp_Height;
                
bpa.pbpa_Width smp->smp_Width;
    
                
IIntuition->IDoMethodA(dto,(Msg)&bpa);


    
            }
            
IDataTypes->DisposeDTObject(dto);
            
smp->smp_Pointer = (Object *)IIntuition->NewObject(NULL,"pointerclass",
                                                      
POINTERA_BitMap,&fallback,
                                                      
POINTERA_ImageData,smp->smp_Buffer,
                                                      
POINTERA_Width,smp->smp_Width,
                                                      
POINTERA_Height,smp->smp_Height,
                                                      
POINTERA_XOffset,-hotX,
                                                      
POINTERA_YOffset,-hotY,
                                                    
TAG_DONE);
            if(
smp->smp_Pointer)
            {
                
smp->smp_Name Dupstr(name,-1);
                if(
smp->smp_Name)
                {
                    
SetID(smp);
                    
result GetID(smp);
                    
IExec->AddTail((struct List *)&skapp->ap_PointerList,(struct Node *)smp);
                    
                }
            }
        }
    }
    if((
result )&& smp)
    {
        
FreePointer(smp);
    }
    return 
result
}

Go to top
Re: Mouse pointer images
Just popping in
Just popping in


See User information
OK. I got icons to load. It was the lack of the fallback image.

Trying your code for images (I was taking it too far and making a NewObject(BitMapClass, and trying to use that) but I don't know where you are getting sizeof(ARGB32).

Workbench Explorer - A better way to browse drawers
Go to top
Re: Mouse pointer images
Home away from home
Home away from home


See User information
@mritter0

SB has a custom ARGB32 type for 32bit image data you can just stick 4 in for that (or sizeof(uint32))


Go to top
Re: Mouse pointer images
Just popping in
Just popping in


See User information
@broadblues

Nice. Works just fine. And will be easier to add more colors now.

Would you happen to have the textpointer instead of hand for the fallback bitmap?


Thanks!

Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project