12-17-2009, 04:07 PM
I have recently started working in Openvg and I am using the iMX35board. I am not able to draw images(.png/bmp) :evil: . i will really appreciate if someone could point me in the right direction.
01-02-2010, 12:46 PM
I load PNG files with either libpng or the Soil library. I then do the following to create a vgImage from the data:
uint8_t *data; // this is a pointer to the decoded image
int stride; // this the decoded data stride, maybe w*bpp (but not always)
image = vgCreateImage(format, width, height, quality); // format is based on the loaded data (VG_lABGR_8888 for example)
vgImagSubdata(image, data, stride, format, 0, 0, w, h);
// you could not free data if you wanted
Now to draw the image
This works for me, hope it helps,
Powered by vBulletin® Version 4.2.2 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.