I am using the Viewport3DX from Helix Toolkit only to Draw into the Content2D Element.
This works fine and very fast.
But the background is White and I would like to have an transparent background.
I can set BackgroundColor to another color but not to Transparent.
ALso the Background Property has no effect.
Is this normal issue is there an hidden option?
So now I know more.
With EnableSwapChainRendering = true the viewport uses HWND to render in the WPF control and therefore there's no transparency.
With EnableSwapChainRendering = false it renders to an D3DImage and transparency works.
Related
I tried my hands on changing the color of NSPopover, I am able to change to it all desired color except transparent.
As, it is known that NSPopover is by default semi transparent. I tried changing the NSWindow color directly, by Layer as well, I also tried setting the NSView's color to transparent i.e. NSColor.Clear but no luck.
So the question is - Is this possible to change the background color of NSPopover to transparent?
No this is (sadly) not possible.
I am using PNG images as main image resource in my application. Since im using Delphi 7, i downloaded PNGImage lib and included it in project. I load images like this:
Form.image.Picture.LoadFromFile(PAnsiChar('\background.png'));
Image has transparent and semi transparent pixels on its border. The problem i get is that transparent pixels are filled with random zoomed part of my desktop with currently opened windows, while i expected to see what is actually located beneath form.
Additionally, form has this properties:
BorderStyle: bsNone;
TransparentColor: true;
Visible: false;
Here is a picture of current state (above black line) and desired:
Can this be fixed somehow or it is how delphi deals with transparency?
To have the form "shade" what's beneath it, use the forms AlphaBlend and AlphaBlendValue properties. The .png image doesn't have to be partially (alpha blended) transparent, but it can be.
If you want the form to be semi-transparent you use Alphablending, that's a limitation of Windows. In addition you can have a certain color fully transparent. In the following sample the forms color is clGray, which is also defined as the Transparent color property in addition to the Transparent property set to True. The image, aligned alClient, is 50% transparent, placed on a TImage which is set as transparent, but even so, it doesn't show up as semi-transparent unless you have AlphaBlending on. Again, this is a limitation of Windows. The best you can do is try with a fairly high value for AlphaBlendingValue (240..250) and a rather light image to find the right compromise.
I was on the way of making a picasa like photo viewer and later an image editor.i used JFrame and alpha channel to set background transparent.but while moving or zooming in/out ,as i had to draw it on different location and clear the previous image i used clearRect and faced the problem.
the oracle documentation says it clears the rect and restores the background color.
on some trials the clearRect clears the area to background color.But while continuous events like mouse-dragging its turning the color of cleared area to black and causing this:
`
thnx
.i used JFrame and alpha channel to set background transparent.
Don't use alpha for complete transparency. Instead just use:
panel.setOpaque( false );
If you are using semi transparency then check out Backgrounds With Transparency. It will explain the problems with transparent background and provide a couple of solutions.
The basic problem is that transparency breaks the painting contract with Swing components because the background is not cleared entirely before child components are painted.
Have been searching through here with no luck, Pretty simple problem, On my emulator all font colors are white (which is what I want).
Testing on a device the fonts are all black now, I have managed to change this by setting the foreground colors on the elements however I am unable to do so on the longlistselector through code.
This works for me:
longListSelector.Background = new SolidColorBrush(Colors.Transparent);
However this has no effect:
longListSelector.Foreground = new SolidColorBrush(Colors.White);
Any other way I can attempt to set the text color on the longlistselector?
The reason foreground colors would be different would be because of the default style. PhoneAccentBrush changes based on if your "phone" is set to have a white background or a black one.
The reason why your longListSelector.Foreground is not working may be because the phoneaccentbrush is set on the items inside the longlistselector from a style?
I saw the splash screen of the Corel-Draw 12 application and lost my mind!
What technique do they use?
On application start-up they load a transparent image, use windows api or what?
How do they achieve this transparency?
Here is a demo project for both VB.NET & C#.
If you are using winforms with vb.net you can modify the opacity of any form by setting the Form.Opacity property. I am not familiar with the splash screen you are speaking about but it shouldn't be too difficult to achieve a similar effect.
If you're using WPF, set the AllowsTransparancy, WindowStyle and Background attributes on the Window object:
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
AllowsTransparency="True"
WindowStyle="None"
Background="Transparent">
<!-- more -->
</Window>
I am also unfamiliar with this flash screen... but if it slowly fades or something, then I would go with Quintin's answer here. Opacity at a certain percentage will show another form through yours.
If the splash screen is just an image and some of it is see-through and some of it isn't, then you can set the transparency key on your form to a certain color, then set the form's background color equal to that, and then whatever image you wish to display should be loaded into a picture box. Make sure you use a .GIF image though! or some other format that supports deleting out the background. JPG's and BMP's are worthless here since their "empty" color becomes white instead of transparent.