problems trying to navigate starting point of gdk_pixbuf with cario in C - gtk3

I have a stitched png file that is 100 frames of a gauge going from 0 to 100. Each frame is 80x80.
I am loading the image into a pixbuf using gdk_pixbuf_new_from_file and attempting
to use gdk_cairo_set_source_pixbuf to navigate to the frame that I want to display.
I am getting the first frame when gdk_cairo_set_source_pixbuf(cr,pixbuf,0,0), however if I try to advance (for example at the gauge at 50%) and use gdk_cairo_set_source_pixbuf(cr,pixbuf,0,4000) ...I don't get anything. I am getting no images other than when I am using 0,0.
I am new to this so any advice on what I may be doing wrong, or suggestions of alternate ways to do what I am looking to accomplish are appreciated. I have been searching for existing examples of someone using a subset of an image, but haven't been able to find any.
thank you.

Related

3D transform image (in Bohemian Sketch)

For my website, I want to use the vector image as shown here: http://www.sketchappsources.com/free-source/226-iphone-5.html
It's an iPhone 5 that is tilted.
Now I need to add my image to the screen which means I need to 3D-tilt it. I've tried and searched a lot but couldn't figure out how to transform my image so that it fits the iPhone 5 screen.
Any help in guiding me how to 3D transform my image would be greatly appreciated!
Cheers,
Frank
I recently released a plugin solving the exact issue, it allows you to draw a shape with the Vector tool and then apply the content of an artboard into the area. It's called Magic Mirror, please take a look at http://magicmirror.design

HUGE image to show on the iPhone

Ok, here's my problem. I have a HUGE jpg file, 18000 x 18000 pixels 41MB in size.
If you really need to know, it's a map of a section of the country with services.
My project is really simple. I just need to be able to zoom and display this granddaddy size image. All the way from aspect fit to 100% on the iPhone. I'm not too sure if this can be done or how long it will take. Would appreciate any insights.
I have tried using imageView but I read that it really shouldnt exceed 1024 x 1024. That is way below what I have. If you have an idea how to go about doing this, please share!
You should split the image into tiles, at a range of magnifications. Calculate and build these off-line, and ship them as individual files in the app bundle. Given the zoom in your display, pick the closest zoom size. You then select which tiles are needed to cover the screen, and make a grid of them. As the user zooms, select the appropriate tile size.
The benefit of this is that you don't ever have to load HUGE files into memory, only as much as needed.
This is how Google maps does it.
Can't give you any code, sorry!
You should follow an approach similar to what Google Maps and other map sites do. You need to slice the whole map in sections, so the users don't need to load the whole map if it's not always necessary (plus makes loading time way faster)
There's a couple of solutions that might work for you like OpenLayers or even creating a Custom Google Map with your images as seen here and here
Here is an example from Apple for processing large images called PhotoScroller. The images have already been tiled. If you need an example of tiling an image in Cocoa check out cimgf.com

Simple form with pixel manipulation in Qt

I'm completely newbie to Qt
i want to create a 800X600 window that just show some circle and be able to manipulate pixels of the form. there is no interaction between user and form(no click, no dblclick,...) it just shows some circles with one color and lines with different pixel colors(each line may have different pixel colors)
also i want to be able to change the coordination system, i mean change it from top-left to the center of the window. could anyone help me do that with some sample code?
thanks in advance for your reply.
Please try downloading the Qt Creator (IDE), then reading through the tutorials. There's a whole host of very useful information provided for free, including a lot of the code samples you are looking for.
The following examples might also be of particular interest:
Animation Framework Examples
Graphics View Examples
Painting Examples

Fake long exposure on iOS

I have to implement long exposure photo capabilities to an app. Since i know that this is not really possible i have to fake it. It should work like "Slow Shutter" or "Magic Shutter".
Sadly i got no clue how to achieve this. I know how to take images with the camera (through AVFoundation) but i'm stuck at merging them to fake long shutter times.
Possibly i need to manipulate and combine all the images with coregraphics but i'm not sure about this (even the how). Maybe there's a better solution to this.
I would appreciate every help i can get here,
thank you people!
You might try the plus lighter blend mode.
Well, I suppose it would be possible to average together the results of several shots. I've mucked around a bit with the core graphics stuff to resize images (averaging together adjacent pixels), but with lower res images. The algorithm I used is here -- maybe it'll give you some ideas.
There may, of course, be a better way, and some tricks for working efficiently with high-res images. Can't help you there.
Convert the images to pixel bitmaps. Align and stack the bitmaps. Then try applying various 3D convolution filters to the 3D pixel array.

Image processing Iphone

I like to develop a hair styling application for which allows the user to take a picture and try different predefined hair styles.I need to correctly place the predefined hair in correct position of image.I really don't know from where i need to start.If any one have any ideas please share it. Thanks in advance .....
Start looking into OpenCV (image processing library) to detect the eyes position and face bounds. You can then compute the location where the hair has to be placed over.
http://opencv.willowgarage.com/wiki/FaceDetection
http://www.codeproject.com/KB/library/eyes.aspx - A sample project which exactly answers you