guiStaticImageGetNativeSize | Multi Theft Auto: Wiki Skip to content

guiStaticImageGetNativeSize

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function gets the native size of image. That means the original size in pixels of the image file.

Syntax

guiStaticImageGetNativeSize ( )

Code Examples

client

This example creates an image at the resource's start and changes its size to the original size so it keeps the best quality.

[lua]
addEventHandler("onClientResourceStart", resourceRoot,
function ()
local image = guiCreateStaticImage(200, 200, 10, 10, "image.png", false) --Creates image at 200x200 point on screen
local x, y = guiStaticImageGetNativeSize(image) --Gets the original size
guiSetSize(image, x, y, false) --Sets the size to native one
end)

See Also

GUI Functions