Gaétan Noël
|
RE: Draw a bitmap with full screen by OpenVG
|
Gaétan Noël
06/22/2009 10:31 AM
post32225
|
RE: Draw a bitmap with full screen by OpenVG
Hi,
You can create a VGImage with size 480x272, and then copy your bits over to it using vgImageSubData. Then set the
VG_MATRIX_IMAGE_USER_TO_SURFACE matrix, and use vgScale to scale it using vgScale(640/480, 480/272). Then use
vgDrawImage to put the pixels on the surface. So, just to recap the VG steps (you still need to create a surface and
initialize EGL...):
1- vgCreateImage
2- vgImageSubData
3- vgSeti(VG_MATRIX_MODE, VG_MATRIX_IMAGE_USER_TO_SURFACE)
4- vgDrawImage
You may also want to change VG_IMAGE_MODE (through vgSeti), depending on the effect you want to achieve.
Note also that this will stretch your image, and the aspect ratio won't be preserved. If you want to keep the AR, then
simply use the same scale in the x & y direction, and use vgTranslate to center the image accordingly.
Cheers,
Gaétan
-----Original Message-----
From: hu xiaohua [mailto:community-noreply@qnx.com]
Sent: June 22, 2009 9:50 AM
To: openvg-graphics
Subject: Re: RE: Draw a bitmap with full screen by OpenVG
I'm very sorry that don't write my intent.
I want to draw a bitmap on the display .
But the size of bitmap data is 480*272,the resolution of my screen is 640*480.
I don't know how to achieve.
Thank you very much!
_______________________________________________
OpenVG
http://community.qnx.com/sf/go/post32216
|
|
|