• Welcome to Vampyre Imaging Library Forum. Please login or sign up.
 

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - mkoijn

1
Hi, Vampyre Imaging is a great library, thanks for making it available. I'm slightly confused by the lgpl license,
can I use the library (I haven't modified it) in a commercial application? I think I can if I understand the license, but do I have to include the source code for vampyr? or do I have to release my source code too? or
do I have to just give credit to Vampyre Imaging in the documentation to the software?

Also, the animated png's I produce with Vampyre look great and work in Opera, but not Firfox 3.6.12, there the colors are all garbled.

best regards

Albert
2
Help & Questions / Screenshot from opengl
24 October 2010, 16:51:27
Hi, I'm trying to use Vampyr to save a screenshot of an opengl window. I'm using Lazarus 0.9.28.2 on windows xp.

I'm using glreadpixels to get the rgba values from the opengl canvas and storing the values in a pointer. Then trying to load the data using LoadMultiImageFromMemory , however it returns an error. Here's my code so far. Any help would be great.

Eventually I would like to save animated gifs from the opengl window, is this possible with the Vampyr Imaging Library? and thanks for making the library available.

procedure TForm1.OpenGLControl1Paint(Sender: TObject);
var
Res: pbyte;
size:longint;
error:boolean;
FImage: Tdynimagedataarray;
begin
if Sender=nil then ;

  glClearColor(1.0, 1.0, 1.0, 1.0);
  glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT);
  glEnable(GL_DEPTH_TEST);

  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  gluPerspective(45.0, double(width) / height, 0.1, 100.0);
  glMatrixMode(GL_MODELVIEW);
  glLoadIdentity();

  glpushmatrix();
  glTranslatef(0.0, 0.0,-6.0);
//               |
//               |
//      Here's code to build opengl picture 
//               |
//               |
   glpopmatrix();

   OpenGLControl1.SwapBuffers;

   Res:=getmem(openglcontrol1.Height*openglcontrol1.Width*sizeof(byte)*4);
   glPixelStorei(GL_PACK_ALIGNMENT, 1);
   glReadPixels(0, 0, openglcontrol1.Width, openglcontrol1.Height, GL_RGBA, GL_UNSIGNED_BYTE, Res);

   error:=LoadMultiImageFromMemory (Res,openglcontrol1.Height*openglcontrol1.Width*sizeof(byte)*4,fimage);
   savemultiimagetofile('C:\test.gif',fimage);

   freemem(Res);
   freeimagesinarray(fimage);
end;                                             
SMF spam blocked by CleanTalk