FAQ Database Discussion Community


How to go from raw Bitmap data to SDL Surface or Texture?

c++,bitmap,textures,sdl,surface
I'm using a library called Awesomium and it has the following function: void Awesomium::BitmapSurface::CopyTo ( unsigned char * dest_buffer, // output int dest_row_span, // input that I can select int dest_depth, // input that I can select bool convert_to_rgba, // input that I can select bool flip_y // input that...

What does the return value of SurfaceTexture.getTransformMatrix mean, who can explain?

android,matrix,crop,surface
everyone: I am working with SurfaceTexture in Android but I am not able to understand Its API: getTransformMatrix(float[] mtx), the API doc is as follows: /** * Retrieve the 4x4 texture coordinate transform matrix associated with the texture image set by * the most recent call to updateTexImage. * *...

Surface 3 + Android emulator?

android,android-emulator,emulator,surface
I am thinking about getting a surface 3 as I cant afford a surface pro 3, and was just wondering if I could run the android emulator on it, from the android sdk, to support my app developments. I would be greatful for any thoughts....

Matplotlib parametric surface plot unexpected results, why?

python,matplotlib,3d,surface,parametric-equations
I am trying to plot an ellipsoid so, I thought I would amend the example code for a sphere from the matplotlib 3D plotting page. from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt from matplotlib import cm import numpy as np fig = plt.figure() ax = fig.add_subplot(111, projection='3d') # Ellipsoid...

Combobox item does not updates when the property changes

c#,wpf,xaml,mvvm,surface
I have a ComboBox with two items (Buy and Sell). but when PropertyChanged (Sell) still not update comboBox(still selected Buy). I 'm working with VS2013 with .Net 4.5 with Windows app .Please help me. This is XMAL code <ComboBox HorizontalAlignment="Left" Grid.Row="5" Grid.Column="0" x:Name="cmbInputAction" VerticalAlignment="Top" Margin="10,0,0,0" Width="195" ItemsSource="{Binding OrderActions}" DisplayMemberPath="DisplayName" SelectedItem="{Binding...

how to create a 3D height map in python

python,matplotlib,plot,3d,surface
I have a 2D array Z that stores the height at that element's position. Other than using the method here in which I need to create array X and Y with the same size as Z, are there any simpler methods to create a 3D height map? The 3D surface...

Treating 2d array data as pixels defining a shape - is it possible to create an inside and a surface?

python,arrays,matrix,pixel,surface
Say I have the following array/matrix in python (any language will do, to be honest). A = [0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 1 1...

How to plot a 3D surface in matlab using set of data [duplicate]

matlab,plot,matlab-figure,surface
This question already has an answer here: How to create a 2D-matrix out of my data for surf()? 2 answers I have a set of 3D data which are not ordered. I need to plot a surface which basically connects them together and color the surface based on my...

Quadratic fitted line doesn't appear in R plot

r,ggplot2,surface,quadratic
When I run following script in R, the fitted line doesn't appear in the plot. I want it to appear though. Can you help me? rm(list=ls()) # Surface tension surft <- c(49.1, 51.7, 50.7, 52.0, 53.5, 52.9, 55.1, 59, 62.5, 66.4, 69.0, 73.8) # surface tension of mixtures # Mole...

Plotting a 3D Cylindrical Surface plot in Python

python,matplotlib,plot,3d,surface
I am trying to create a cylindrical 3D surface plot using Python, where my independent variables are z and theta, and the dependent variable is radius (i.e., radius is a function of vertical position and azimuth angle). So far, I have only been able to find ways to create a...

Surface plot piping to gnuplot from C

c,2d,gnuplot,surface,piping
I've made a function which successfully pipes data from my C program to gnuplot: void gnuprintabs(FILE *gp,double **RE,double **IM, double x[], int N) { int i,j; fprintf(gp, "splot '-'\n"); for (i=0; i<N; i++) { for(j=0; j<N; j++) { fprintf(gp, "%g %g %g\n", x[i],x[j],sqrt(RE[i][j]*RE[i][j]+IM[i][j]*IM[i][j])); } } fflush(gp); fprintf(gp, "e\n"); } The...

Displaying surface with non-rectangular boundary

matlab,image-processing,plot,3d,surface
Refer to the attached image. I want to display the image in Matlab using the function surf(). However, I only want to display the region of the actual object without the background (the pale-green region surrounding the actual object which has 0 value). How to do that? I tried replacing...

Gnuplot 3D - plot scatter points and a surface *and* lines between the them

plot,3d,gnuplot,surface,scatter3d
I've been unable to find a way of producing the plot described in the title, does anyone know how to do this if it's possible? I'd like to plot a surface from a function, and plot points from a file, and have lines drawn between the points and the surface....

How to fit a 3D surface to geographic coordinates?

matlab,matrix,surface
Good day everyone; I have a M*N matrix and I have two coordinate vectors X and Y, where X has the length of M and Y has the length of N but they have different values because M is an array index and X is a Latitude coordinate, for example...

Email from excel not working in window 8 2013 issue

excel,vba,windows-8,outlook,surface
Im using the following code and its been working fine. i have updated to a surface pro and know my macro have stop working. i think it has some think to do will this line in Set OutApp = CreateObject("Outlook.Application") With window 8 i don't think it uses outlook anymore...

Stacking of several Surface plots in 3D-View

r,plot,3d,surface
Lets consider that I have five 2D-Matrices which describe the magnetic field at different z-Layers. A nice, smoothed version of a 2D-Surface plot can be obtained as follows: data2_I<-matrix(c(1.0,1.0,0.6,0.6,0.7,0.9,0.9,0.5,0.5,0.5,0.7,0.9,0.9,0.6,0.3,0.4,0.7,0.9,0.9,0.7,0.5,0.5,0.6,0.9,0.9,0.7,0.6,0.6,1.0,1.0), nrow=5) Z = as.vector(data2_I) length(Z) XY=data.frame(x=as.numeric(gl(5,1,30)),y=as.numeric(gl(5,6,30))) t=Tps(XY,Z) surface(t) Now it would be great if I could get a 3D-plot where at...

Set the pixel format AND create texture from surface in SDL

c++,pixel,sdl-2,surface,pixelformat
I am currently trying some things using pixel manipulation and I would like to set the pixel format of a SDL_Surface. The problem here is that I am loading up an image with the SDL_image.h. So I have to create a texture from a surface like this: surface = IMG_Load(filePath);...

Wanting to write an app for surface pro tablet

windows-8,surface
i want to write an app for surface pro tablet ( but not for the windows 8 rt, where do i start as there are much information available. are their any book to which i can refer to? how do it differ from writing an app for the Windows...

How can I smooth a surface in MATLAB?

matlab,matlab-figure,surface
I have a surface in matlab which is plotted using the following code: [xi, yi] = meshgrid(S/K, days); vq = griddata(S/K, days, rbf/K, xi, yi,'natural'); mesh(xi,yi,vq) The resulting image is quite rough, and has lots of grid lines as there are roughly 200 data points in each vector. Is it...

Display the maximum surface in matplotlib?

matlab,matplotlib,plot,surface
I'm plotting multiple surfaces on the same figure using matplotlib, and I'd like to see only the topmost surface, as matlab shows. Matlab 3D view: Matlab top view: Matplotlib 3D view: Matplotlib top view: How can I get Matplotlib to show a result similar to Matlab, in which whatever topmost...

MATLAB - 3D surface plot

matlab,plot,3d,surface
I have 20 data points in 3D space. Here you can see them plotted: clear all close all clc Data = [97.4993 104.3297 0.7500 196.7021 100.0000 105.0000 0.7500 290.9164 100.0000 107.5000 0.7500 142.1626 96.2569 106.4992 0.7500 143.3605 97.5028 104.3317 1.0000 197.1111 100.0000 105.0000 1.0000 290.4210 100.0000 107.5000 1.0000 144.0155 96.2530...

MATLAB - Plot multiple surface fits in one figure

matlab,plot,colors,3d,surface
I have 3 sets of 3D co-ordinates and I have fitted planes to each set. Now, I want to plot all the data points and the 3 planes in one figure. So far, I have the following function: function [fitresult, gof] = create_fit(xx, yy, zz, grp) [xData, yData, zData] =...

TypeError: must be pygame.Surface, not list

python,pygame,surface
This is my code and I was trying to make a rectangle: import pygame import sys pygame.init() color = [255,20,78] black = [0,0,0] screen = pygame.display.set_mode((800,600), 0, 32) pygame.display.set_caption("Rectangle") while True: for event in pygame.event.get(): if event.type == pygame.QUIT: pygame.quit() sys.exit() screen.fill(color) pygame.draw.rect(color, black, [400,300,10,10]) pygame.display.update() I don't understand what...