About Store Forum Documentation Contact



Post Reply 
GuiImage vs Import.
Author Message
Salival Offline
Member

Post: #1
GuiImage vs Import.
Hello, I want to ask a few questions about the GuiImage and normal rendering.

What is the diffrence between:

Init:
pImg.Import( "../data/Textures/test.dds", IMAGE_A8R8G8B8, IMAGE_2D, 1 );

Draw:
Vec2 ImageSize = D.pixelToScreenSize(VecI2(44,44));
pImg.draw(0,0,ImageSize.x,ImageSize.y);

And

Gui += pImgObj.create(Rect_LU(0,0, ImageSize.x, ImageSize.y), Images("../data/Textures/test.gfx"));

Gui.draw();


When I import the test.dds image it looks perfect, But when I load an GUI Object ( test.gfx ) it looks blured. All same size.

And if I try set the Imported image to the GUI Object "pImgObj.set( pImg )" it crashes.

Thank you.
(This post was last modified: 05-21-2010 09:34 AM by Salival.)
05-21-2010 09:26 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: GuiImage vs Import.
in 2 cases you're using different files (dds,gfx) maybe they're different

Quote:"pImgObj.set( pImg )" it crashes
please paste your code, because it shouldnt happen
05-21-2010 09:34 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #3
RE: GuiImage vs Import.
possibly you're defining pImg locally (inside method) and it gets deleted?
it should be allocated in constant memory address when you're referencing the image later.
05-21-2010 09:38 AM
Find all posts by this user Quote this message in a reply
Salival Offline
Member

Post: #4
RE: GuiImage vs Import.
(05-21-2010 09:38 AM)Esenthel Wrote:  possibly you're defining pImg locally (inside method) and it gets deleted?
it should be allocated in constant memory address when you're referencing the image later.

Now it allocated it correct and it works. Now I load dds file to the GuiObject, But it's still blured and not sharp like when you do the normal draw from the Image itself.

What can be wrong?

pImg.Import( "../data/Textures/test.dds", IMAGE_A8R8G8B8, IMAGE_2D, 1 );

Blured:
Gui += pImgObj.create(Rect_LU(0,0, ImageSize.x, ImageSize.y), &pImg);
Gui.draw();

Not Blured:
pImg.draw(0,0,ImageSize.x, ImageSize.y);
(This post was last modified: 05-21-2010 09:50 AM by Salival.)
05-21-2010 09:44 AM
Find all posts by this user Quote this message in a reply
Salival Offline
Member

Post: #5
RE: GuiImage vs Import.
So why are GUIImages not render the same way as if you render images yourself in the draw method?
05-21-2010 10:52 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #6
RE: GuiImage vs Import.
they draw the same way..
GuiImage has additional rect_color
05-21-2010 11:39 AM
Find all posts by this user Quote this message in a reply
Post Reply