I am looking to find a way to create a raster image of a canvas in windows phone 7. I want to be able to either save the image or share it (MMS, email, ect). I am just starting to learn C# and about Silverlight, so this is uncharted waters for me.
Thank you,
Doc Haven
I am not sure if this is the best way to go about this, but this is how I have found my solution to my own problem:
One of the constructors for the WriteableBitmap class allows you to pass it a UIElement and a Transform such that the call new WriteableBitmap(canvas, null); would create a WriteableBitmap from the Canvas. I later set my Image source to that WriteableBitmap.
I do hope that this helps anyone else that may come into this issue in the future!
Thank you,
Doc Haven
checkout the RenderTargetBitmap class, you can create a bitmap image of any visual element then do what you want with it.
Related
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'm drawing some lines in an InkCanvas which I'm converting to a BitmapImage. I want to merch this image with another BitmapImage, but I can't find any way to do this in UWP. Does anyone know a good way to do this?
I suggest you to use WriteableBitmap with WritieableBitmapEx instead of BitmapImage. Then simply use WriteableBitmap's new Blit() function with None as BlendMode and you should have the desired effect.
I have an image of a living room, which I'm turning into a menu for a new site I'm working on. The idea is that you can click on certain items in the room, like a chair, desk, couch, etc and get taken to the desired page. I'm wondering if there is a clever way of doing this. Since the items are not simple shapes, I don't want to use a standard image map.
Thanks for you help!
I'm answering because a Google search brought me here...
Because you asked for a tool:
GIMP Has a really good Image map creation function.
Open your image in GIMP and select Filters > Web > ImageMap
From there you can create image maps by drawing on the image. Saving will generate HTML you can then tailor to your needs.
This tool looks to be a solid image mapper: http://www.image-maps.com/
I'd suggest doing this with a canvas and SVG's, it would make this quite a bit easier, and more professional.
As Korvin mentioned, doing this in SVG is probably the easiest option, because you can attach events to objects in SVG rather than having to manually specify a particular area in which to listen for events.
If you go this route, I recommend using the RaphaelJS library which has a nice syntax and the advantage of working in IE pre version 9. Here's a demo which, although it uses onmouseover instead of onclick, it might be close to what you're trying to achieve:
http://raphaeljs.com/australia.html
I'd like to append a border (20px white) to an image, save as a new jpeg image (orginal image with a border), I don't know how do I start. Can anyone give me a direction or code example?
Thanks
You have two ways to do it:
On your UI, wrap the image with a Border element with the correct settings and use new WriteableBitmap(borderElement, null) to create a new WriteableBitmap which you can then save using the SaveJpeg extension method.
Your other option is to use the WriteableBitmapEx class library to graphically add the graphical elements you want.
I've used both. The advantages for (1) is that there's less hassle in the sense of adding a dependeny on another DLL. The advantage in (2) is that you don't need to mess with your UI to create the image.
How to read and draw image from isolated storage in xna???
I don't know why you would want to do this, but anyways, you would need actually implement System.IO.IsolatedStorage.
http://www.windowsphonegeek.com/tips/All-about-WP7-Isolated-Storage---Read-and-Save-Images
Read up on that, and try to use Texture2D instead of a BitMap image.
I know you can make a new Texture2D from Microsoft's Content Pipeline, but the Texture2D constructors are weird.
You can also try making a Silverlight and XNA Project and see what it does when you have a BitMap within the GraphicsDevice.
I am sorry I am making you try these things cause I am away from my computer right now.
Very unusual request :P
Best of luck,
Robert.