October 31, 2025, 04:53:44 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


SetIcon problem

Started by aurelCB, May 31, 2010, 04:54:13 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

aurelCB

May 31, 2010, 04:54:13 PM Last Edit: May 31, 2010, 04:56:18 PM by aurelCB
Hi..
I have problem with SETICON comand,not work for me- what i do wrong.
from help:
QuoteExample usage

hIcon = LOADIMAGE( "c:\\images\\prog.ico", @IMGICON)
SETICON mywindow, hIcon

i use this command many times in CB and there works fine.
I do this :
UINT iconic
iconic = LOADIMAGE("c:\\absmall.ico", @imgicon)
'----------------------------------------------------------------------------------------
OPENWINDOW w1,winL,winT,MeWidth,MeHeight,@caption|@minbox|@maxbox|@size,0,capmain$,&main
SETICON w1,iconic


I made icon as usual 16x16 in 256 colors.
so what i do wrong?

LarryMc

Is absmall.ico really in the root directory of your c drive?

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Copex

June 01, 2010, 03:07:39 AM #2 Last Edit: June 02, 2010, 03:26:46 AM by Copex
*DELETED* @larry sorry didnt read it correctly
-
I really should learn how to use a spell checker! though im not sure how it will help someone who can not spell?
-
Except where otherwise noted, content Posted By Copex is
licensed under a Creative Commons Attribution 3.0 License

http://creativecommons.org/licenses/by/3.0/

hugh

June 01, 2010, 04:59:34 AM #3 Last Edit: June 01, 2010, 07:59:26 AM by hugh
this is the from the users guide



hIcon = LOADIMAGE( "c:\\images\\prog.ico", @IMGICON)
SETICON mywindow, hIcon


so that tells me to create a folder called "images" on drive C:\, and save my icon there.
You have to find were you saved your icon and give the full path

SORRY, Code is from EBasic Reference Manual

Regards
hugh

aurelCB

QuoteIs absmall.ico really in the root directory of your c drive?
Yes larry it is on disk C.
I try all posibile combination but still dont work.
What may cose this problem?

LarryMc

Aurel
attach your ico so I can see if it works for me.

Aslo, did you try it with different icon?

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

aurelCB

Hi Larry here is this small icon 16x16 in 256 colors.
I try many others and dont work,im totaly confused why dont work?


LarryMc

Aurel
I made a little test program and it worked fine for me.
Try this program on your computer.
UINT iconic
iconic = LOADIMAGE("c:\\absmall.ico", @imgicon)
'----------------------------------------------------------------------------------------
capmain$="test"
window w1
OPENWINDOW w1,0,0,100,100,@caption|@minbox|@maxbox|@size,0,capmain$,&main
SETICON w1,iconic
centerwindow w1
int run =1
waituntil run=0
DELETEIMAGE iconic,@imgicon
CLOSEWINDOW w1
end

SUB main
    IF @CLASS = @IDCLOSEWINDOW
        run=0
    ENDIF
RETURN
ENDSUB


LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

aurelCB

June 02, 2010, 12:13:59 PM #8 Last Edit: June 02, 2010, 12:15:52 PM by aurelCB
Yes it works now ;)
Thanks Larry i dont know that i must use DELETEIMAGE
mean i know that is this proper way but i dont use this in CB.
I forget about roule for releasing resource to system.
So if i want use similiar in ABasic i must find way to releasing resources on exit.

LarryMc

CBasic also has the DELETEIMAGE command.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library