Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-12-2007, 01:21 AM
godofwarares godofwarares is offline
Webmaster
godofwarares's Avatar
Join Date: Dec 2006
Location: Florida
Posts: 552
godofwarares is on a distinguished road
Send a message via ICQ to godofwarares Send a message via AIM to godofwarares Send a message via MSN to godofwarares Send a message via Yahoo to godofwarares
Showimg img width & height

How do I show an image with showimg with the specified image width and height?

Is there a way to do this?
__________________
What signature? I see no signature?
Reply With Quote
  #2  
Old 03-12-2007, 02:01 AM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
You can use stretchx and stretchy to stretch the image.

To work out the size of the stretched image its easy:

image width * stretchx = displayed image width.

The other way around is fairly simple. Just:

stretchx = desired width / actual width
__________________

Coming soon (Hopefully:P)

Last edited by JkWhoSaysNi; 03-12-2007 at 04:00 PM..
Reply With Quote
  #3  
Old 03-12-2007, 02:05 AM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
You can't do it with showimg but you should be able to with drawimagestretched.
__________________
Reply With Quote
  #4  
Old 03-12-2007, 02:41 AM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
image.width & image.height
__________________
Deep into the Darkness peering...
Reply With Quote
  #5  
Old 03-12-2007, 04:35 AM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
Quote:
Originally Posted by Angel_Light View Post
image.width & image.height
Orly? Well I guess thats less on the hands then getimgwidth() or getimgheight()
Reply With Quote
  #6  
Old 03-12-2007, 12:40 PM
godofwarares godofwarares is offline
Webmaster
godofwarares's Avatar
Join Date: Dec 2006
Location: Florida
Posts: 552
godofwarares is on a distinguished road
Send a message via ICQ to godofwarares Send a message via AIM to godofwarares Send a message via MSN to godofwarares Send a message via Yahoo to godofwarares
Quote:
Originally Posted by Googi View Post
You can't do it with showimg but you should be able to with drawimagestretched.
Thats for a GuiDrawingPanel.

Quote:
Originally Posted by Angel_Light View Post
image.width & image.height
I'll try that later.
__________________
What signature? I see no signature?
Reply With Quote
  #7  
Old 03-12-2007, 02:14 PM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
if it's not that that it's imgheight and imgwidth
__________________
Deep into the Darkness peering...
Reply With Quote
  #8  
Old 03-12-2007, 03:17 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by Angel_Light View Post
if it's not that that it's imgheight and imgwidth
Wont really work, would have to be imgwidth(image) and imgheight(image), and thats gs1 afaik.
Reply With Quote
  #9  
Old 03-12-2007, 04:00 PM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
in gs2 it's getimgwidth("name.png"); and you can't set the width with it.

as i said you can just use

PHP Code:
with(showimg(200,"image.png",x,y)) {
stretchx 300/getimgwidth("image.png");

Will make the image 300px wide on screen.

n.b. the only issue with this is that X and Y of the showimg will not be in the top left corner of the image any more.
__________________

Coming soon (Hopefully:P)
Reply With Quote
  #10  
Old 03-12-2007, 04:12 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Yes you currently need to use stretchx and stretchy to change the size. To correct the position of the image you need to do then:

PHP Code:
+= (1-zoom*stretchx)/2*getimgwidth(image);
+= (1-zoom*stretchy)/2*getimgheight(image); 
Another way is to use a polygon with an image:
PHP Code:
polygon = {x,yx+mywidth,yx+mywidth,y+myheightx,y+myheight};
image "yourimage.png"
Replace mywidth and myheight with the preferred size. This will only work if you display a full image (not using partx etc.)

The simpliest way would be to use a GuiBitmapCtrl, I am not sure where you want to display it though.
Reply With Quote
  #11  
Old 03-12-2007, 09:30 PM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Couldn't you just do new TDrawingPanel?
__________________
Do it with a DON!
Reply With Quote
  #12  
Old 03-13-2007, 11:05 PM
godofwarares godofwarares is offline
Webmaster
godofwarares's Avatar
Join Date: Dec 2006
Location: Florida
Posts: 552
godofwarares is on a distinguished road
Send a message via ICQ to godofwarares Send a message via AIM to godofwarares Send a message via MSN to godofwarares Send a message via Yahoo to godofwarares
Details, Details Zokemon. I'll try various things and we'll see what works best.
__________________
What signature? I see no signature?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 11:47 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.