Graal Forums  

Go Back   Graal Forums > Development Forums > Future Improvements
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-08-2009, 06:19 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
TDrawingPanel.setTransparency()

Well I recently read that TDrawingPanel works serverside, and this is pretty much the only reason why I wouldn't have an in-game uploading option.

Possible usage:
TDrawingPanel.setTransparency(red, green, blue)
__________________
Quote:
Reply With Quote
  #2  
Old 07-20-2009, 01:19 AM
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
What exactly is your suggestion (making all pixels of a specific color transparent ?)
Reply With Quote
  #3  
Old 07-20-2009, 02:42 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by Stefan View Post
What exactly is your suggestion (making all pixels of a specific color transparent ?)
Yes, you know how artists typically paint the background one color then set that as the transparent color?

In theory I would use it like so..

This is serverside usage

PHP Code:
// Declare Source Image
temp.sourceimg "source.png";
// Create Panel and Draw Source Image
temp.img = new TDrawingPanel();
temp.img.setsize(getimgwidth(sourceimg), getimgheight(sourceimg));
temp.img.drawimage(00sourceimg);
// Get Top Left Pixel Color
temp.rgb img.getPixelRGB(00);
// Set Image Transparencies
temp.img.setTransparency(rgb[0], rgb[1], rgb[2]);
// Save the Image
temp.img.saveimage2("levels/image/newimage.png"8); 
Which reminds I think functionality to get the RGB value of a certain would be needed as well.

TDrawingPanel.getPixelRGB(x, y); - returns {red, green, blue}

This wouldn't hurt either..
TDrawingPanel.isimgpixeltransparent(x, y) - returns boolean ( like the scripted clientside function )

I'd use this functionality to make it easier for players to create their own heads, bodies, shields, other player content, and have it uploaded in-game versus emailing, or other systems. Typically most newbies usually just open the graphic in paint, and submit the BMP's. Provided they will still have to upload them in the right format but setting transparencies can be a difficult task.
__________________
Quote:

Last edited by fowlplay4; 07-20-2009 at 03:03 AM..
Reply With Quote
  #4  
Old 07-20-2009, 02:55 AM
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 wiki.graal.net
getimgpixel(imagefile,x,y) - returns an array of {red,green,blue}
Reply With Quote
  #5  
Old 07-20-2009, 02:58 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by Crow View Post
Script help for 'getimgpixel':
Clientside:
getimgpixel(str, int, int) - returns object

I could use that and some wild scripting but.. it'd be alot easier if that functionality was available in serverside TDrawingPanel.
__________________
Quote:
Reply With Quote
  #6  
Old 07-20-2009, 03:09 AM
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 fowlplay4 View Post
Script help for 'getimgpixel':
Clientside:
getimgpixel(str, int, int) - returns object

I could use that and some wild scripting but.. it'd be alot easier if that functionality was available in serverside TDrawingPanel.
Well, in your example above, you would just replace this:
PHP Code:
temp.rgb img.getPixelRGB(00); 
With this:
PHP Code:
temp.rgb getimgpixel(temp.sourceimg00); 
Reply With Quote
  #7  
Old 07-20-2009, 03:52 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by Crow View Post
Well, in your example above, you would just replace this:
PHP Code:
temp.rgb img.getPixelRGB(00); 
With this:
PHP Code:
temp.rgb getimgpixel(temp.sourceimg00); 
Yes but that's only clientside, I'm asking for serverside functionality, anyway let's just get both on the serverside if possible.
__________________
Quote:
Reply With Quote
  #8  
Old 07-20-2009, 04:36 AM
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
Ohh, right. I completely forgot what the topic actually was about. Sorry about that, heh.
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 08:27 PM.


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