Blackberry – how to resize image?

You can do this pretty simply using the EncodedImage.scaleImage32() method. You’ll need to provide it with the factors by which you want to scale the width and height (as a Fixed32). Here’s some sample code which determines the scale factor for the width and height by dividing the original image size by the desired size, … Read more

Transformation of 3D objects related to vanishing points and horizon line

This is nowhere near my cup of tea so handle with extreme prejudice and also far form solution just some start point hints… First of all we need to define some constraints/assumptions in order to make this to work. user selects 4 lines representing 2 perpendicular planes and these 2 QUADs have the same height … Read more

How to recognize rectangles in this image?

Opencv (image processing and computer vision library written in c) has implementation for hough transform (the simple hough transform find lines in an image, while the generalized one finds more complex objects) so that could be a good start. For the rectangles which do have closed corners there are also corner detectors such as cornerHarris … Read more

Closest point on a cubic Bezier curve?

I’ve written some quick-and-dirty code that estimates this for Bézier curves of any degree. (Note: this is pseudo-brute force, not a closed-form solution.) Demo: http://phrogz.net/svg/closest-point-on-bezier.html /** Find the ~closest point on a Bézier curve to a point you supply. * out : A vector to modify to be the point on the curve * curve … Read more

How to print R graphics to multiple pages of a PDF and multiple PDFs?

Did you look at help(pdf) ? Usage: pdf(file = ifelse(onefile, “Rplots.pdf”, “Rplot%03d.pdf”), width, height, onefile, family, title, fonts, version, paper, encoding, bg, fg, pointsize, pagecentre, colormodel, useDingbats, useKerning) Arguments: file: a character string giving the name of the file. For use with ‘onefile=FALSE’ give a C integer format such as ‘”Rplot%03d.pdf”‘ (the default in that … Read more

Does anyone know of a low level (no frameworks) example of a drag & drop, re-order-able list?

heh I hate frameworks so this is easy as pie for me… this is what I coded for my students during my lectures few years back: http://ulozto.net/x2b7WLwJ/select-drag-drop-zip This is the main engine code (complete project + exe is in that zip above): //————————————————————————— //— Constants: ———————————————————— //————————————————————————— const int _select_max_l=16; const int _select_max_ll=_select_max_l*_select_max_l; const int … Read more