It's urgent - Image Drawing

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
parul
Not too shy to talk
Not too shy to talk
Posts: 22
Joined: Mon Feb 14, 2005 05:11

It's urgent - Image Drawing

Postby parul » Mon Jun 06, 2005 11:05

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

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Re: It's urgent - Image Drawing

Postby lindquist » Mon Jun 06, 2005 14:57

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.

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

User avatar
parul
Not too shy to talk
Not too shy to talk
Posts: 22
Joined: Mon Feb 14, 2005 05:11

Re: It's urgent - Image Drawing

Postby parul » Tue Jun 07, 2005 07:29

Hi

Thanks a lot.

Regards,
parul


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 10 guests