View Full Version : transparent window
mgokkaya
02-16-2007, 07:04 AM
how can i use this slider for transparency of window ???
http://www.indigorose.com/forums/showthread.php?t=15195&highlight=slider+framework
i need an example please !!!!
http://www.indigorose.com/forums/showpost.php?p=75659&postcount=4
This one uses the slider plugin, but all you need to do is used the code in the slider in the custom event of the slider framework.
mgokkaya
02-16-2007, 07:30 AM
I Have That One But I Want To Use The Other One...
I Tried But I Couldnt Manage It
mgokkaya
02-16-2007, 07:52 AM
I Tried That But When I Touch The Slider It Disappears
TristanD
02-16-2007, 08:03 AM
HINT: try not to make the window fully transparent as you will not be able to open see it anymore (so you cant close it)
mgokkaya
02-16-2007, 08:07 AM
HINT: try not to make the window fully transparent as you will not be able to open see it anymore (so you cant close it)
can i find a way to make people not to make fully transparent ???
Couple things...
If you are using a horizontal slider with the SliderFrameWork, the image names need to start with hslider_ and hknob_. If the slider is vertical, then it needs to start with vslider_ and vknob_.
You were using a horizontal image set with the naming convention of a vertical slider, therefore the slider was moving up and down, not across, so it didn't take much to go from 0 to 100%. So change the image names to hknob_Opacity and hslider_Opacity.
Also, the way the SliderFrameWork works is that 0 is at the left for horizontal and top for vertical. To start the slider knob on the left in this case, the Custom Event needs to be like this instead
-- Custom event
function On_Slider_Move(sCurrentSlider, nPercent)
-- use this event to make change the values the slider
-- is related too
if sCurrentSlider == "hknob_Opacity" then
sOS=String.Right(System.GetOSName(),2);
if (sOS == "XP" ) or (sOS == "00") or (sOS == "03") then
handle = Application.GetWndHandle();
nOpacity = Math.Floor(255 * (nPercent/100))
--makes the slider work in reverse
nOpacity = 255 - nOpacity
result = DLL.CallFunction("AutoPlay\\Docs\\wTrans.dll", "SetWindowTransparency", handle..","..nOpacity, DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL)
end
end
end
mgokkaya
02-16-2007, 08:19 AM
i dont want users make fully transparent so is there anyway to do it ???
mgokkaya
02-16-2007, 08:22 AM
i found it WORM
thanks alot
mgokkaya
02-16-2007, 08:39 AM
an other error is;
WHEN I TOUCH THE SLIDER WINDOW GOES BLACK AND THEN TURNS THE NORMAL...
HOW CAN I FIX IT ???
To make it so the window doesn't go completely transparent, I'd do this.
-- Custom event
function On_Slider_Move(sCurrentSlider, nPercent)
-- use this event to make change the values the slider
-- is related too
if sCurrentSlider == "hknob_Opacity" then
sOS=String.Right(System.GetOSName(),2);
if (sOS == "XP" ) or (sOS == "00") or (sOS == "03") then
handle = Application.GetWndHandle();
nOpacity = Math.Floor(220 * (nPercent/100))
--makes the slider work in reverse
nOpacity = 220 - nOpacity
result = DLL.CallFunction("AutoPlay\\Docs\\wTrans.dll", "SetWindowTransparency", handle..","..nOpacity, DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL)
end
end
end
As for the brief window glitch. I don't know...
mgokkaya
02-16-2007, 09:05 AM
-- Custom event
function On_Slider_Move(sCurrentSlider, nPercent)
-- use this event to make change the values the slider
-- is related too
if sCurrentSlider == "hknob_Opacity" then
sOS=String.Right(System.GetOSName(),2);
if (sOS == "XP" ) or (sOS == "00") or (sOS == "03") then
handle = Application.GetWndHandle();
nOpacity = Math.Floor(255 * (nPercent/180))
--makes the slider work in reverse
nOpacity = 255 - nOpacity
result = DLL.CallFunction("AutoPlay\\Docs\\wTrans.dll", "SetWindowTransparency", handle..","..nOpacity, DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL)
end
end
end
thats what i did and it worked perfect
mgokkaya
02-16-2007, 09:08 AM
but when i transparent the window and maximize the window the slider goes to the begining but it is still transparent
The code posted for resizing doesn't take into account that an object may move. The knob is moved back to the original position, because that where the resize code initially saw it. You either need to reset the tblOriginalPositions info for the slide, or handle it manually. The custom event is only fired if you manually move the slide. The on resize code moves it via code, so you too will have to fire that event via code.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.