I have an unique image that I want to draw inside expression blend using the Path data property and class, how can I extract the path from a image? It will be impossible to draw it to perfection, what software tool can I use to get the path?
Related
I have a large image, based on a vector drawable xml file, and I would like to visualize only part of it in an ImageView, like this (the darker regions would be off screen):
Under user control, the image would move around (or rather, the visible part of it), very much like a Google maps app.
I can manage to dig into Android Studio but I would like to get some hint on what would be a proper approach to handle this. Is using a large xml file and clipping it appropriate or is it better drawing it on a canvas in runtime?
I played with both vector drawables and drawing on a canvas, but not enough to be sure which way to go for this or to post any code.
Is there a way to show text outline on a TextBlock? I am showing some text on top of map control and would like to show the text in black with white outline so it's always readable. Something like this:
Thanks for any tips
This sort of font manipulation isn't supported in Windows.UI.Xaml, but you can interop to DirectWrite to draw text with effects into a bitmap and then composite the bitmap on top of your map.
For static text you can either pre-create a bitmap or convert the font to paths as Chris W says. The Windows.UI.Xaml.Shapes.Path's Data is essentially the same as SVG's, so you can use many vector graphics programs for the converstion by saving to SVG and then copying the path data from SVG Path's d= attribute to Xaml Path's Data= attribute.
Drop shadows aren't supported in Windows.UI.Xaml without interop to Direct2D, so the fake it link won't give any advantage over DirectWrite in this environment.
The simplest way to ensure contrast would be to place the text on a partially transparent box, but that will give a different look.
Can't figure out how do I prepare the images for the Iconic tile on WP8. The guide is here. My tile is very simple - no counter, no variable text. Just the image and the app title.
So I should provide two image files - IconImage and SmallIconImage (the XML elements in the manifest are called differently, by the way). But which size should I make them? The guide says the tile is 159x159 and 336x336, respectively; but the icon within the tile is 110x110 and 202x202. The rest is text and counter, as overlaid by the Windows Phone shell.
Which size should I use for my two images? Should I just draw the icon, or a larger image some blank space and the icon in the required boundaries?
EDIT: relevant discussion here.
The correct size would be:
Small: 72×110
Medium: 132×202
You can find more details here http://mikaelkoskinen.net/windows-phone-8-iconic-tile-image-size-comparison
The guide is showing that you make your icon 110x110 and 202x202. The 159x159 and 336x336 shown in the guide are noted for the size of the tile. If you want to use the Iconic Template, you do not create the entire tile like you used to. Instead you designate the icon to be used within the tile. Search for "icon" within this link. http://www.developer.nokia.com/Community/Wiki/What%27s_new_in_Windows_Phone_8
I'd like to generate and draw some bezier paths based on an image in my app. The image will be really simple (black lines on a white background) such as the following:
Is there a method to process the image and create a bezier path based on the black lines? I'm completely lost here.
If you're wondering the reason for needing the image to be a bezier path, I'm going to be comparing the generated bezier path with another bezier path that the user draws (basically a picture-password that the user will have to draw).
If there's a better way to accomplish comparing an image to a bezier path, I'm all ears. Or, if bezier paths aren't the way to go, then let me know. Thanks!
Why not do it the other way around?
let the user draw the path
create an image from the drawn path using core graphics
compare both images with a framework like opencv
You cannot do this with bezier lines. Those are curves, while what you want is lines.
If you wanted to solve for control points though the solutions for this inverse problem
are infinite therfore you must set the number of control point that the bezier curve has.
I've created a canvas within which I display an image that is clipped when it goes over the edges. I can do this fine with a square shaped frame, however the frame I want to use is the one below. Is there any way I can clip the image inside the frame without having to add a non transparent square border around the image, i.e. just using the black line that I've already drawn? (on iPad)
You'll need to use Core Graphics and Quartz to handle this sort of clipping/graphics manipulation.
http://developer.apple.com/library/ios/#documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/Introduction/Introduction.html#//apple_ref/doc/uid/TP30001066
If you're using UIBezierPath, you may be able to achieve the clipping you're after using the following process
http://developer.apple.com/library/ios/#documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_paths/dq_paths.html#//apple_ref/doc/uid/TP30001066-CH211-TPXREF101
Convert your UIBezierPath to a CGPath
Get your image into a CGContext
Add your CGPath to the context via CGContextAddPath
Clip your context using CGContextClip
Alternatively, if you don't want to be messing with paths (and depending on whether this technique is suitable for your situation, your description of the issue makes it hard to tell), it might be worth using image masking to achieve the effect you're after. See the first link and look under "Bitmap Images and Image Masks".