OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: velasquez on December 16, 2008, 02:43:42 AM

Title: Background and Transparency in Version 5.0
Post by: velasquez on December 16, 2008, 02:43:42 AM
The inclusion of the property of background color in a form and of transparency in the controls are excellent for OpenDCL. 
But some controls don't work well with transparency they make the bad work. 
Can this be modified? 
Thanks
Title: Re: Background and Transparency in Version 5.0
Post by: owenwengerd on December 16, 2008, 08:38:18 AM
The only solution I'm aware of is to set your controls to not use visual styles. When you use a visual style, the style overrides the background colors in some controls.
Title: Re: Background and Transparency in Version 5.0
Post by: velasquez on December 16, 2008, 12:33:41 PM
Only to know, if which won't the transparency property work well the reason for her to exist?
Title: Re: Background and Transparency in Version 5.0
Post by: BazzaCAD on December 16, 2008, 12:59:54 PM
Quote from: velasquez on December 16, 2008, 12:33:41 PM
Only to know, if which won't the transparency property work well the reason for her to exist?

Because it does work well. These are just a small few example where it doesn't.
Sometimes these types of issues are outside of Owen's control. Microsoft creates the controls and down always expose everything for manipulation.
Title: Re: Background and Transparency in Version 5.0
Post by: mr nick on March 04, 2009, 11:04:23 PM
I have just run into this issue myself when trying to set the color of one of my dialogs. Would I be correct in thinking that it is currently impossible to get a frame and a tabstrip to correctly display a transparent or colored background? Most other items can be resolved by turning off the themes but these two don't seem to work for me  :'(
Title: Re: Background and Transparency in Version 5.0
Post by: Fred Tomke on March 04, 2009, 11:12:02 PM
Hello, mr_nick, can you upload a project file where we can see this form?

Please note: if the user changes the windows system colors that may have negative influence to your forms. so handle with care!

Fred
Title: Re: Background and Transparency in Version 5.0
Post by: mr nick on March 04, 2009, 11:36:59 PM
Do I need to upload anything? The issues I'm seeing are the same as those in the image in the first post - i.e the text on the frame won't display on a transparent background and the area at the side of all the tabs will also only display in grey.
Title: Re: Background and Transparency in Version 5.0
Post by: Fred Tomke on March 05, 2009, 12:39:41 AM
Frame: If you don't override the form's back color you won't have any problems with the background of the caption. On the other hand you can set the frame's caption to an empty string and draw a label control onto the frame. Then it will be transparent, too.

Tab: It may be a display setting in Windows that the tabs with VisualStyle are white in the background. I cannot say anything about this.

I also tried the original Microsoft Frame control as ActiveX control but this doesn't support transpareny in OpenDCL so far as I could see.

Fred
Title: Re: Background and Transparency in Version 5.0
Post by: mr nick on March 05, 2009, 02:09:00 AM
Quote from: Fred Tomke on March 05, 2009, 12:39:41 AM
Frame: .... you can set the frame's caption to an empty string and draw a label control onto the frame. Then it will be transparent, too.

OK, this has given me a workable solution - not ideal but better than nothing.

Quote from: Fred Tomke on March 05, 2009, 12:39:41 AM
Tab: ..... I also tried the original Microsoft Frame control as ActiveX control but this doesn't support transpareny in OpenDCL so far as I could see.

I just tried this in VBA and it's not possible there either so I'm guessing this one's a no-go.

Thanks for the tip on the first one Fred  :)
Title: Re: Background and Transparency in Version 5.0
Post by: velasquez on March 05, 2009, 03:40:24 AM
Hi 
I got to solve the problem in TabControl using a PictureBox. 
It seems that worked well.

Velasquez
Title: Re: Background and Transparency in Version 5.0
Post by: Fred Tomke on March 05, 2009, 04:52:11 AM
Hi, velasquez, that looks fine. Am I right that you put an image in the background of each tab with the gradient blue to white?

Fred
Title: Re: Background and Transparency in Version 5.0
Post by: velasquez on March 05, 2009, 09:15:34 AM
Hi Fred, you this certain? 
See the image.
Title: Re: Background and Transparency in Version 5.0
Post by: Fred Tomke on March 05, 2009, 09:27:32 AM
Ah, thanks. I'm deeply impressed!

Fred
Title: Re: Background and Transparency in Version 5.0
Post by: Fred Tomke on March 06, 2009, 06:02:19 AM
velasquez:

When I use your image file I only see a grey rectangle and not a gradient. Do you really use this file? But maybe you don't load this file into the image list of the *.odcl project file?

Fred
Title: Re: Background and Transparency in Version 5.0
Post by: BazzaCAD on March 06, 2009, 07:01:23 AM
did you set the tabs background to -24
Title: Re: Background and Transparency in Version 5.0
Post by: Fred Tomke on March 06, 2009, 07:10:43 AM
Barry: if you meant me, no, in that case I used a modless form without tabs. Finally, I draw a new picturebox and then the image worked great. I deleted the old one.

Fred
Title: Re: Background and Transparency in Version 5.0
Post by: velasquez on March 06, 2009, 09:47:35 AM
Fred: 
I use this image inside of the list of my ODCL. 
TabControl -> Heigth = 432 - Width = 244 
PictureBox -> Heigth = 413 - Width = 244   
 
I created this with OpenDCL 4.1.2.2 
 
Velasquez
Title: Re: Background and Transparency in Version 5.0
Post by: Fred Tomke on March 06, 2009, 10:08:16 AM
I see you're using JPG. I had not so nice experiences in using JPG. In some cases good looking images are changing after importing into OpenDCL Studio. That's why I asked.

Fred
Title: Re: Background and Transparency in Version 5.0
Post by: owenwengerd on March 06, 2009, 10:09:44 AM
That reminds me... as far as I know you never did attach the requested samples of failing images to your old bug report about this.
Title: Re: Background and Transparency in Version 5.0
Post by: Fred Tomke on March 06, 2009, 10:13:05 AM
Ooops ... I'm getting older and older.
Title: Re: Background and Transparency in Version 5.0
Post by: Fred Tomke on March 06, 2009, 10:34:42 AM
Owen, was it a bug report on sourceforge? I cannot find it...
Nevertheless I send an example for imagine:

Image 1 shows the icons during design time.
Image 2 shows the same form after saving, closing and reopen.
Image 3 shows the result in AutoCAD.

I also attached the original files.
I tested it with bmp, too with the same result.

Fred
Title: Re: Background and Transparency in Version 5.0
Post by: owenwengerd on March 07, 2009, 04:43:35 AM
Good news! This problem should now be fixed (but you'll have to re-import the images). The problem was that they were being placed into a temporary image list set to the "default" color depth. I changed it to always use 32-bit color depth, and this appears to have resolved it.
Title: Re: Background and Transparency in Version 5.0
Post by: Fred Tomke on March 07, 2009, 05:56:38 AM
That sound great; Owen!
Thank you!