mIRC Homepage
Posted By: milosh Icon in dialog problem - 02/03/06 07:48 PM
Hi people.
I know that it will look a little stupid asking this, especially if you work with dialogs 7-8 years, but I could not find an answer so I have to forget my pride and ask anyway.
I haven't used icon in my dialog table so far, so I looked in mirc help file and found this:
Code:
icon	id, x y w h, filename, index, style    (noborder top left bottom right)

I tried this:
Code:
dialog sample {
  title "Picture Dialog"
  size -1 -1 300 300
  option dbu
  icon , 1, 50 50 100 100, "blabla.bmp", 1, noborder
  button "Accept",10,48 75 30 11,ok
  button "Cancel",11,80 75 30 11,cancel
}

and I get nothing... an empty dialog with two buttons.
I hope somebody will help.
Thank you!
Posted By: MikeChat Re: Icon in dialog problem - 02/03/06 08:03 PM
Quote:
Code:
icon	id, x y w h, filename, index, style    (noborder top left bottom right)

you have
Code:
icon , 1, 50 50 100 100, "blabla.bmp", 1, noborder


what is the actual width and height of the bitmap

you have after the file name" 1," ("blabla.bmp", 1, noborder) yet in the example right amove from the help file it shows Either use Index which will go in the frame replacing the mIRC icon at the top left of your dialog, or use the "styles" of (noborder top left bottom right). Not both, not 1.

one thing I have seen in using images in dialogs as you may need to use negative number to properly register the icon. Whether or not this is while using DBU or not I am unsure as I always use DBU as the dialog type option.

so icon, 123, -10 -25 70 100, noborder

when using an image as the icon for the index, 16 x 16 to 64 x 64 is about it for definition.
Posted By: milosh Re: Icon in dialog problem - 02/03/06 08:35 PM
Thank you. But I still can't do what I want... I want to have bmp picture in my dialog, and after reading your post, I tried this
Code:
icon , 123, -10 -25 70 100, "blabla.bmp", noborder
but no luck. Do I have to specify the exact (actual) picture width and height or I can use 70 x 100 if I know that my picture will fit into this?
Posted By: MikeChat Re: Icon in dialog problem - 02/03/06 09:36 PM
the icon in dialogs does not work like drawpic in @windows
you have to use the actual file width and height
to get them (from the help files)
$pic(filename)
Returns the size, width, and height of a bmp, jpg, or png file.
Properties: size, width, height

so use $pic(filename).width $pic(filename).height to get the image size

if you want to use an image but in a different size then you will have to edit it in a graphics software that can do what you want.
Posted By: milosh Re: Icon in dialog problem - 08/03/06 03:48 AM
Thank you very much.
© mIRC Discussion Forums