Hi All,
I have one basic query regarding image drawing. I am using defineImage function of image set class to define image and draw function of Image class for drawing the image.
1) If i give size of the image same as actual image size it draws the proper image.
2) but If i give size smaller then the actual image size, then imgae cuts down. i.e. it picks up specified no of pixels from the image.
3) and if i give size greater then the actual image size then it fills the remaining area of image with white space.
but i want to Stretch and compress the image according to given size of the image. Is their any method in CEGUI or OGRE to support image Comression and Stretch so that when i will define the image with different sizes then application shows the complete image.
i am waiting for response. it's really very urgent. i am not able to proceed without solving this problem.
Thanks,
Parul
It's urgent - Image Drawing
Moderators: CEGUI MVP, CEGUI Team
- lindquist
- CEGUI Team (Retired)
- Posts: 770
- Joined: Mon Jan 24, 2005 21:20
- Location: Copenhagen, Denmark
Re: It's urgent - Image Drawing
Are you using a StaticImage or are you writing the draw code yourself?
CEGUI::StaticImage has a h/v-formatting setting that you can use to control these things.
use the member functions:
to set the horz/vert formatting.
as to writing your own draw code.
All you should have to do is calculate the right pixel-rectangle that you wan't the image to be drawn inside.
The texture-coordinates should not change, and the image will stretch/shrink all by itself to fit that rectangle.
HTH
CEGUI::StaticImage has a h/v-formatting setting that you can use to control these things.
Code: Select all
enum HorzFormatting {
LeftAligned, RightAligned, HorzCentred, HorzStretched,
HorzTiled
};
enum VertFormatting {
TopAligned, BottomAligned, VertCentred, VertStretched,
VertTiled
};
use the member functions:
Code: Select all
StaticImage::setHorizontalFormatting
StaticImage::setVerticalFormatting
to set the horz/vert formatting.
as to writing your own draw code.
All you should have to do is calculate the right pixel-rectangle that you wan't the image to be drawn inside.
The texture-coordinates should not change, and the image will stretch/shrink all by itself to fit that rectangle.
HTH
Re: It's urgent - Image Drawing
Hi
Thanks a lot.
Regards,
parul
Thanks a lot.
Regards,
parul
Return to “Modifications / Integrations / Customisations”
Who is online
Users browsing this forum: No registered users and 10 guests