I want to draw some shapes over an image.
After the image is loaded and added to the layer, I use the moveToBottom() function, which works for shapes but doesn't seem to work with images.
I've tried to use moveToTop() on the shapes, but still no luck.
Important note: I have to keep them on the same layer, so the obvious solution to put the image in another layer is not an option.
http://jsfiddle.net/hukNL/
This concept shows that layering functions work, so the error is somewhere else in your code.
First of all, you want to be using the newest KineticJS 4.3.1, then you want to make sure that if you are dragging images that you disable putting them in the dragOnTop layer that is now featured in the newer releases. Lastly, if nothing else works, then you could manually debug your code by checking the z-index of each item by using:
.getZIndex()
Also, if you would like more help, post some code so others can help you debug it.
Related
So I have a programming project that I have to do for my school. What I have to do is setup a 2 player dice game. I could have gone the easy way and just display the number of the 2 die, but I was thinking of using images that I made in photoshop instead. However, the problem is that I do not know how to change images in an efficient way.
My first option is using the visibility tag on several images laid on top of eachother and change it accordingly as such
image1.visible = false
image2.visible = true
However, I do not think that is very efficient. Images also do not support changing the image with code from my research.
Secondly, I could use a PictureBox instead, which do support changing the image as the program is running. However, it does not support transparency, and the die images are transparent. Plus it gives me the invalid image file error, I guess due to the transparency in the gif files.
There is also the cheap workaround of me making the background of the images the same as the form background.
So is there a more efficient way I am missing out? I know that the cheap workaround would be the best option for this case, but I would like to have this knowledge for future use like semi-transparent pixels that blend in and such.
And before you ask, no, I cannot use another programming language as visual basic 6 is what my school teaches. Thankfully they are changing it soon, but I am stuck with this for now.
Turns out you CAN change the pictures of Images, while keeping transparency and stretch. I am going to properly show it:
Image1.Picture = LoadPicture("YOURPATHHERE.gif")
This is what I get for believing what I've seen on some forum.
Also, the error of invalid image file was due to the images being corrupted for some reason.
I've Googled around a lot, and I checked the Unity Asset store but I cannot seem to find what I think is a common problem (or perhaps I'm doing it wrong).
The issue is when I use the Sprite Editor I cannot see a reference image which is useful for setting the sprite pivot.
When I open the Sprite Editor on a given image file, I cannot seem to add a background reference image:
I want to be able to see a background image (of a specific character for example) that I can position and then use that to set the pivot.
Do you know of any way to do this? Asset Store references are acceptable.
I found one for Animation pivot setting but not for static images.
Any and all suggestions welcome (if you have a workflow suggestion that mitigates this issue, feel free to suggest :) )
I found a free option that works well enough:
http://gnupart.tistory.com/entry/Unity3D-Custom-Sprite-Pivot-Editor-in-SceneView
I have been able to get almost everything I need into the editor, But cannot figure out how to get a collada model that was imported to play it's keyframes.
Since I am not doing loader.load (collada) blah blah like in the examples. I cannot figure out how to get the animations. Animations is always undefined, but I know keyframes exist. Any ideas?
as far as i know, animations in the editor are not fully implemented yet.
the corresponding code in the viewport is commented out (line564+)
i think your best shot is to modify the editor (and eventually create a PR) or go back to coding everything.
the editor in its current form only shows the basic functions but the code is quite well structured to allow implementing custom features.
A quick update that animations in the Three.js Editor are now supported. Below is a gif from the linked PR demonstrating usage.
I am building an Eclipse RCP application, based on eclipse 3.5.
I'd like to modify an image at runtime. The image is loaded and will be used as an icon, but depending on the situation, I'd like to add a filter on the image to give it a red or orange color, depending on some user-configured value.
It's the image transformation that I'm interested in. I already know how to get the image and ask a component to display it.
Has anybody done that? Thanks for your help :)
There are possibly many choices for doing just that, you can use ImageIO to load an image as BufferedImage and then get the Graphics2D and modify it as you wish. When you are finished modifying you can reaasign the newly created image back into your component which holds the original image and thats it.
You can of course look for some libraries to allow you easier image manipulation, maybe jmagick or something similar.
You can use DecoratingLabelProvider with a suitable ILabelDecorator. See also FAQ What is a label decorator?
I have a flex app I am scaling using systemManager.stage.scaleMode=StageScaleMode.NO_BORDER; for the most part it works well except for my bitmap data (mostly png's from the designers).
I can set the mx:image tags to smoothBitmapContent=true and that works great for everything except my mouseover objects. When I do a mouseover, the source is being changed from one embedded image to another embedded image. I have tried several (many) online "smoothimage" classes, and tried to write my own, I have tried to reset smoothBitmapContent every chance I get but still no dice. It seems to mee that because I am scaling at the app level, that the flopped out bitmap is not getting smoothed when it renders.
How to keep things smooth? Perhaps there is a flag to tell Flex to smooth stuff when it scales it?
So the easy answer (that works for me) was to instead of changing the image.source from one embedded png to another, was to use two images and flip flop image.visible between the two... Granted that adds two extra objects to the screen, But for some reason they all stay smoothed and scaled that way, where as before switching sources was going from smooth to jaggidy and un-readable.
Josh