Getting Views Rows Data in Custom Module I dont know if im over thinking this but im not making much progress with my function. I am trying to get the values from views rows in my modules for example if I was to use $row-&gt;field_name inside of a view.tpl file then it would show the output of that row, except I am trying to do it in a module. Ultimately I am trying to render the image style of the 1st image that loads from the view. This is what I have so far.

function custom_module_views_pre_render(&amp;$vars){
    if($vars-&gt;name == 'front_page'){
        $vars-&gt;result[0]-&gt;field_field_image[0]['rendered']['#image_style'] = 'front-page-scroll';           
    }
}


Update 1: I've attached a image of what I am trying to do seeing how when I use preview(); execute(); or render(); it makes the function stop working, actually it makes the whole site stop working. If I cant get to the field view result count which counts the the number a current node is then I can say if($views-&gt;view_result_counter == 1) then render just that node. The function would look something like this.

function custom_module_views_pre_render(&amp;$vars){
    $views = views_get_current_view('front_page', 'page');
    if($views-&gt;name == 'front_page'){   
         if($views-&gt;views_result_counter == 1){
            $vars-&gt;result[0]-&gt;field_field_image[0]['rendered']['#image_style'] = 'front-page-scroll';
         }
    }
}


Here is a image of what I am trying to do, Now I currently have the 1st image rendering as I want it to but it keeps rendering the image of each page instead of it rendering one time only.



Now as for my view is there any reason why execute or render wouldnt work? this is what my view looks like.


any suggestions?
as this site is not about php programming I will not go very deep into this. but what you are probably looking for is http://api.drupal.org/api/views/views.module/function/views_get_view_result/7

to render the view use $view-&gt;render();

further reference: http://drupal.org/node/342132