How to make curve and rounded image in Blackberry 10 native? - image

I am trying to curve and round the image but I am not able to do it perfectly. I have tried to create an .amd file and set it as the background but this is not working perfectly. Is there any other way through which I can make the image round as well as curved on a Blackberry - 10.?
I am getting an image as a response from the server like below:
I want something like the following images.Images are not static they are dynamic it's comes from web service.
I have checked the links from the BlackBerry forums also but did not get a proper solution. If anyone knows then please let me know.

To put rounded corners on an image I would use the the Nine Slice feature described in the API. Using a drawing program crreate a small square example of the frame. Using the nine slice system to scale it to the size of your image and lay it over your image.
The same procedure will work for cicularly vignetting images. Depending on howmany sizes you want you may have to draw them on the fly or have several sizes and scale to other sizes.

Related

Netlogo : Set Size and Position of drawing

I have created a Netlogo program in which I imported cars using following code:
import-drawing "F:\\BMW.png"
It imports the image as background and stretches the image in whole screen. I want to resize it, but cannot do it using set size 2 as its used for resizing of built in shapes (as far as I know). Can someone please guide me how can I resize my PNG image and also set it to a specific coordinates (say 0,14).
Any help will be appreciated. Thanks
It won't change anything for how your model works, so you can just use:
set-patch-size XXX
If you dont want to guess at what patch size you want, you can just drag the size smaller until it's about the size you want, then click on info for GUI and it will have a patch size there.
I'm not sure what you mean by resize your png however.

NSCursor images on a retina display

I am trying to modify the default I-beam cursor image. I'm using [[[NSCursor IBeamCursor] image] representations], passing each one through a CIFilter and adding it to a new image. However, the resulting cursor looks as though it is rendering the low-resolution images.
The High Resolution Guidelines say:
For custom cursors, you can pass a multirepresentation TIFF to the NSCursor class method initWithImage:hotSpot:.
So I would expect this to work. Additionally, if I get the -TIFFRepresentation of the original image and my modified image, and write them to disk, they both look like multi-page TIFF files with the same size images. What could I be doing wrong?
I have a somewhat-temporary solution: manually call -setSize: on each image representation, dividing the pixel height and width by the screen's scale factor. However, this technique doesn't seem like it will work ideally with multiple screens.
You're right on. I've been debugging this all day and I'm pretty sure I've got it nailed. I'm not doing exactly the same thing you are (my images are loaded from a file) but the end result is exactly the same.
The trick is to set the first representation of the multi-representation image to the non-retina size. If you are loading your cursors from an image file, you must take this extra step to adjust the size of the representations to match. It doesn't work 'out-of-the-box' as you would expect.
I've tested this on a machine with two monitors and dragging the window from the retina display to the non-retina display acts as it should, displaying the high/low resolution images for the cursor.
I had a similar problem a while ago: I had my cursor in a PDF, and it always drew as if it was a pixel image at 1:1 size, blown up. There's a solution to that in NSCursor: Using high-resolution cursors with cursor zoom (or retina).
Maybe someone can use that technique to solve this problem? My guess is creating an image with the same size but a different CTM marks it as the same size but Retina. What #jtbrandes is doing probably marks it as a different size and non-Retina. So you're effectively losing the scale factor information. If you create an image with a CTM in the hints, maybe you can draw the filtered images into it and it'll be detected right.

Stitching multiple images into one SL / WP7

I am trying to download a number of images, of differnet sizes, then after some cropping stitch them into one single image.
I am intending to do this in code on a WP7 device
My current approach uses n Image controls and waits for their ImageOpened events to fire. Once they have all been successfully opened I create a new Image for each and stick them into a StackPanel.
In then use WriteableBitmap to create a single image from the stacked images.
This code works 40/50% of the time. The rest of the time the layout engine decides to not bother laying them out in a horizontal stack. All the images get rendered on top of each other.
Is there a way of forcing the StackPanel to do a full layout pass? I have tried combinations of Arrange and Measure on both the Images and the StackPanel.
I found the article WP7: Generate Live Tile Images Locally (Without The Visual Tree). I am now using Henry Chong’s approach (which includes UpdateLayout) and my photo stitching is working great.
I cannot help but be amused by the fact that the answer to my question “how the hell do I force the layout to be updated” was answered with a method called “UpdateLayout” [dev exits stage left kicking himself]

Drawing large images for ipad

I am developing an application for viewing images.
I used the example of PhotoScroller Apple to implement this application.
In my application I want to be able to draw on the image.
I had the idea to put a UIView on top with transparent background and draw the lines via touch events. This solution has become very slow because the generated images are very large, around 3700x2000 pixels.
I also tried a solution with the example of Apple GLPaint that uses OpenGL, but it has a size limitation of 2048x2048 pixels.
Anyone have any idea or example of how I implement this?
I think you should try and tile your image.
One option is using CATiledLayer. Have a look at this short tutorial.
Or you could try and use CGContextDrawTiledImage to get your stuff done. Possibly this post from S.O. could help you getting started.

Rotating a set of images

I am trying to setup a "rotating image" for part of a site I am working on. I have taken many photos of a single item (30+), and I want to display them like it is a rotating 3D image (with a possible draggable speed).
One approach I have taken is setting it as a CSS background, and looping through the images every 0.1s. It works alright, but it flickers like crazy until the image has done a full rotation (I am assuming this is because the image is not yet cached)
Has anyone implemented something similar or have a suggestion?
Much appreciated.
jQuery Cycle is an amazingly versatile, light-weight, jQuery plugin.
http://jquery.malsup.com/cycle/

Resources