Image become scrambled at a certain size inside NSImageWell - xcode

I got an exceedingly strange problem. I have a SidebarDocumentsIcon.icns file (the same one used by finder) that I load into an NSImageWell. However, at certain critical sizes(width between 17-18 pixels) my image becomes completely scrambled in both the interface builder and the compiled app. This only happens to certain images for some reason, and never used to happen before. I tried to restore my repository, made sure that every byte is in the right place, but still this annoying bug keeps on happening. Has anybody here experienced this problem before? Any tips on solving it?

Related

Blurred text in the TStatusBar control

I have for a very long time experienced a hugely annoying problem with the TStatusBar VCL control, a thin wrapper around the Win32 status bar control.
Since this appears to me as a very common and frustrating issue, I am very surprised Google (and StackOverflow) doesn't seem to know much about it.
The problem is that the status bar text becomes very blurred when it hasn't changed for a while; the precise conditions are still unknown to me. But I see this every day:
If one of the panels has its text updated, the new text is rendered correctly (see last panel):
Is this something that only happens when I am in the vicinity of running Delphi processes, or is it indeed a known issue? More importantly, is there a known cure? (And, academically, why does this happen? It wouldn't surprise me if it is related to transparent drawing of anti-aliased text by code originally designed for unthemed Win9x.)
I have tried to enable double-buffering, but I am not sure if that completely resolves the issue. (I have seen even worse behaviour in non-double-buffered list view controls, which is resolved by making them double-buffered.)
I made all status bars in my applications double-buffered a week ago, and I haven't seen any blurred text in any of them since then. Previously, I saw severely blurred text daily. Hence, it seems like this issue - whatever is causing it - can be fixed by making the status bars double buffered.

Draw2d: Containing RectangleFigure will sometimes cuts off text when zoomed. (Pictures included)

In my program I have a bunch of RectangleFigures where each figure holds text. The text is held in a TextFlow which is held by FlowPage to allow word wrapping. RectangleFigure then uses getPrefferedSize() to make itself just big enough to hold it's text (using a fixed width).
These RectangleFigures are held by a ScalableLayeredPane. The problem rises when I try to zoom by calling setScale(). Most of the time it works fine but occasionally the ends of the text will be cut off. If I zoom again the figure will correct itself. I should also say that I have tested my program using Figure instead of RectangleFigure with the same result.
Has anyone dealt with this bug before and can shed some light on why this is happening and/or know of any workarounds?
I havn't included any code because this is a rather large program and relevant chunks of code are spread out. But if you would like to see the code let me know and I will try piecing it together.
I was holding the text inside a Figure and that was the Figure I was calling getPrefferedSize() on. But I then put that Figure(lets call it textFigure) inside a second Figure(called containerFigure). I was essentially doing the equivalent of containerFigure.setSize(textFigure.getPrefferedSize()).
You're probably wondering why I was doing that. Well originally I planned on having containerFigure hold multiple things instead of just textFigure. I ended up coding it differently but forgot about the unnecessary extra layer.
So even though containerFigure was technically the size it needed to be scaling caused problems. But when I removed containerFigure and started placing textFigure directly on the screen this bug was fixed.
This is a fairly specific error on my part so I don't know how much help this will be to others. To make it more broad if you're having some kind of sizing issue just check to see how the size of parent Figures are being set. Using sizes from child Figures might be incorrect and/or causing problems.

Show images very fast, picturebox/panel to slow

Okay the Title can be misleading.
But it´s like this.
I have made an application that constantly sends Images from Client A to Client B.
When Client B receives the image, it will replace the last image.
I currently use Picturebox or Panel, so pretty much:
panel1.BackgroundImage = Image.FromStream((MemoryStream)NetSerializer.Serializer.Deserialize(tt1.GetStream()));
It looks weird though, but as you can se, it will just change the image, when it´s there.
This all goes well up to about 800x600, then it will bottleneck.
I don´t know the update frequency, but i am guessing it´s around 60fps, as i am taking screenshots from my desktop or particular windows.
The bandwidth is not the problem here as long as i don´t use .bmp at 800x600+ of course.
Anyway, my question is, what can i use to replace this way of showing images?
I am guessing something with Directx/OpenGL or something?
Sadly i haven´t found a way to even display an image with that, though then again, i have a hard time understanding it.
I am open for suggestions and examples.
EDIT:
I am thinking, maybe to use WPF to just show the image.
But i don´t know if i can change the background image from a winform, so if it´s possible then i am all ear.
Thanks

White rectangles appear when adding moviclips to the stage

I'm working on a pretty complex AS3 project. I have a few "screens" (which are just movieClips I add to the stage), which contain several .PNG images. These images are loaded dynamically from files on my server. They display correctly, but sometimes (and only in Chrome, as far as I can see) I also have white rectangles appearing beside these images, or where they used to be after I remove them from the stage.
I have been trying to solve this for a few days now, and still have no idea why this is happening...
PROBLEM SOLVED!
After many frustrating tests, I have changed the wmode from transparent to opaque, and voila... everything works as expected. I have no idea why, but it works well now...
Thanks for the advice!

Java3D: Very poor performance in applet on MacOS X

I'm trying to do some animations using Java3D on a Mac.
If I use universe = new SimpleUniverse(); to create a universe, everything is fast. The problem is that there's a bit of tearing sometimes because I'm altering object properties while in the middle of rendering. What I would like to do is stop the rendering while I'm updating properties.
My first step was to try creating my own Canvas3D, and that's where things went wrong. Rather than just creating a SimpleUniverse, I do this sort of thing:
GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration();
canvas = new Canvas3D(config);
universe = SimpleUniverse(canvas);
When I do this, the first problem is that the window doesn't automatically appear. So based on the example at java2s, I embedded the Canvas3D in an applet. Then I get a window, but performance is TERRIBLE. The rendering is MUCH slower.
It's almost as though the rendering is no longer being done by the graphics engine but instead in software.
Can anyone give me some tips as to what I'm doing wrong here?
Thanks!
You should try compiling your BranchGroups before they become live. This helps preprocess the objects before they get displayed in the universe. It might also be something else that java is getting hung up on, if you put the whole source in the question, then i could tell you more. It might also just be your computer, Java3D takes a big hunk of Memory and is pretty CPU intensive, your computer specs would also be relevant in answering this question
Hope that helped you out a little bit, if you add more to your question i would be happy to help you more

Resources