mIRC Homepage

Custom Window on Desktop With Transparent Bkg

Posted By: thenapalmtheory

Custom Window on Desktop With Transparent Bkg - 24/04/12 06:30 AM

So I basically want to have a @window with rounded corners and this is what I have so far:

Code:
alias dtv.drbkg {
  var %win = @dtv.bkg | if ($window(%win)) close -@ %win
  window -Bphf +d %win 1 1 150 300
  drawrect %win 1 2 0 0 150 300
  drawrect -fd %win 14 1 0 0 150 300 10 10
  drawrect -fd %win 15 1 1 1 148 298 10 10
  drawrect -fd %win 0 1 2 2 146 296 10 10
  drawsave %win $scriptdirdtv_bkg.bmp
  close -@ %win  
}


I can't seem to get rid of the tiny corners on the rounded edge. Is there a way to do this without a .dll?
Posted By: argv0

Re: Custom Window on Desktop With Transparent Bkg - 24/04/12 06:55 AM

you can /setlayer 128 @window to make it 50% transparent (the range is 0-255, 255 being fully opaque). It's not a supported/documented feature, and only works on desktop windows, though.
Posted By: thenapalmtheory

Re: Custom Window on Desktop With Transparent Bkg - 24/04/12 11:58 PM

Quote:
/setlayer 128 @window


That makes the entire window (and everything drawn to it) transparent. This is not what I'm looking for.

The alias I posted before, coupled with this alias:

Code:
alias dtv.win {
  var %win @dtv , %bkg $scriptdirdtv_bkg.bmp
  if (!$exists(%bkg)) dtv.drbkg
  if ($window(%win)) close -@ %win
  window -Bdpf +nd %win 1 1 150 300
  drawpic -t %win 0 0 0 %bkg
}


It draws the pic and makes the 'black' corners disappear but only to show the window color beneath. How would I get the window color not visible, but what is drawn to it visible and NOT transparent? I don't want to see the background color of the @Window.
Posted By: thenapalmtheory

Re: Custom Window on Desktop With Transparent Bkg - 25/04/12 02:48 AM

Just to be clear, I'm wanting a @Window with an INVISIBLE background so I can create custom rounded window borders.
Posted By: argv0

Re: Custom Window on Desktop With Transparent Bkg - 25/04/12 11:19 AM

This can't be done with anything in mIRC right now.

My guess is, for your functionality to be added, mIRC would have to change the way it draws picture windows in order to allow a transparent background but still draw opaque data on top. mIRC would have to explicitly support this mode. I'm not sure it's worthwhile, given that it's not that commonly needed. You're better off with a dll in the meantime.
Posted By: thenapalmtheory

Re: Custom Window on Desktop With Transparent Bkg - 25/04/12 11:40 PM

Booooo. I guess I'll go with a square window as I don't want to include any dlls. Thanks for the info.
© 2019 mIRC Discussion Forums