I am using 32bit PNG files with transparency. I added them to an image list with properties:
ColorDepth: Depth32Bit
TransparentColor: Transparent
When I assign the image to my toolbar button, it previews in Visual Studio fine with the correct transparency. But when I run the application the transparency is all messed up with black covering the semi-transparent regions.
How do I fix this?
If you add them directly to the toolbar without using an image list I think they will draw correctly.
The solution apparently is to put
Application.EnableVisualStyles();
Before the start of your application. This has fixed the transparency issue.
Solution Reference
MSDN on EnableVisualStyles
Related
I'm a UX designer - so bear with me. We have an issue where we want to use PDF files as icons for our iOS app. This works fine if we were to only use them in one color. However we have situations where we need to change the color based on the BG they are used on.
The issue is that we are not able to tint the PDFs - they remain white.
The icons are all made in Figma and are used for web / android and iOS. They work perfectly as SVGs and are flattened - so that should not be the issue. Might it have something to do with the way PDF exports work from Figma perhaps?
To tint the PDFs we use renderingMode(_:) which does not seem to actually tint our PDF icons. It works for PNGs, which of course is not optimal as the icons turn out very grainy.
Here is an example of the code used:
SwiftUI.Image.init(uiImage: uiImage)
.renderingMode(.template)
.foregroundColor(label.tintColor)
Here is an example SVG & PDF from the icons that do not work:
Icons from Wetransfer
I'm working on an app that has a custom NSView on a NSStatusBar which performs all of the drawing when the user clicks it. But here's the problem, the color I'm currently drawing as the view's background color is not the same as the system blue color.
My app's color:
Twitter's menu item color (system):
As you clearly see, my blue color is way lighter than the system. This is the code I'm currently using (and worked perfectly on versions older than Yosemite):
[[NSColor selectedMenuItemColor] set];
NSRectFill(rect);
I've even tried color picking the menu item's color but it seems like the color is affected by the wallpaper below the menu bar.
Any ideas on how to achieve the system look?
As you said, in Yosemite, docks, status bars etc. are affected by whatever is behind them. Try enabling System Preferences > Accessibility > Display > Reduce Transparency and you'll see what your color looks like without this feature./
Here is an idea - Maybe you should use the Vibrancy effect and derive from NSVisualEffectView. I knew that I've seen a very similar thread somewhere here in the past, and it took me quite some time to find it. Here it is:
Trouble matching the vibrant background of a Yosemite NSMenuItem containing a custom view
I think Matthes' answer to that question would lead you to the resolution of your issue. Be sure to check it out. I hope it will help - Good luck and report back!
I just recently got a new set of icons for my app (from an external designer) and I am trying to implement them, but for some reason it ends up looking like this (the new icon is the one in the middle):
I have tried setting the image of the tab bar to have UIImageRenderingModeAlwaysOriginal, but that's given me no luck.
Here's the icon (it kind of blends into the background but its a white envelope):
Any reason why this is happening and how I can fix?
The problem is that the entirety of your image is opaque - at least part of it needs to be transparent to appear as you want it to.
In the below image (since the entire thing is white now, it's directly below this text), I have removed the black line and made that transparent. I then added this image to a tab bar, and it worked fine for me.
Here's the link to the image, as well.
What I ended up doing was setting using UIImageRenderingModeAlwaysOriginal for the tabbar image in the awakeFromNib method...that seemed to fix the issue.
I would like to change the background color of the editors preview of added images. All my images I get from the art team are white. Can I set the background preview of the Images.xcassess screen to be black somewhere?
I dont want to set the default tint of these images to non-white.
There is a plug-in for Xcode which take care of that pretty nicely...
TOCAssetCatalogBackground:
https://github.com/toco/TOCAssetCatalogBackground
recommend to install and look for it via Alcatraz - Very simple & very easy.
I am having an issue where my animated .gif (created in PhotoShop) transitions are not rolling out correctly on an iPad and iPhone.
Instead of fading to the next frame, the next frame is appearing a yellow object without having the smooth fade to it.
It is animating just not a smooth animation.
You may wish to use imagemagick to see if it can solve the problem for you. I've just had to deal with a GIF file which has been working without any issue on desktop browsers, but on ios it has been showing strange blue artifacts.
Just run the GIF through the convert function and then try the output file.
convert original_file.gif output_file.gif
Imagemagick will probably decode the original file before creating a fresh new output, but without including whatever encoding style caused problems in the original.