Results 1 to 2 of 2

Thread: Displaying Images

  1. #1
    Junior Member
    Join Date
    Dec 2009

    Displaying Images

    I have recently started working in Openvg and I am using the iMX35board. I am not able to draw images(.png/bmp) . i will really appreciate if someone could point me in the right direction.


  2. #2

    Re: Displaying Images

    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
    vgTranslate(x, y);

    This works for me, hope it helps,
    Brian Edmond
    Crank Software Inc.

Similar Threads

  1. Basic help with displaying images
    By flipscrackers in forum OpenVG
    Replies: 5
    Last Post: 10-12-2010, 05:46 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Proudly hosted by Digital Ocean