Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

change image to grayscale on fly

For general discussion related FlowStone

change image to grayscale on fly

Postby Logado » Thu Apr 02, 2015 7:47 am

This is possible on the fly to change the color of the image. Methods of work with images not found :cry:
Logado
 
Posts: 62
Joined: Tue Jan 06, 2015 5:42 pm

Re: change image to grayscale on fly

Postby KG_is_back » Thu Apr 02, 2015 2:46 pm

In ruby, there are no methods to read or change pixels of a bitmap. In green, there are getPixel and setPixel prims, but to alter entire image you'd need enormous loops, which would likely create massive CPU waste.
KG_is_back
 
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: change image to grayscale on fly

Postby tulamide » Thu Apr 02, 2015 4:12 pm

You could make use of the FreeImage Project. You would then download the FreeImage DLL (http://freeimage.sourceforge.net/download.html) and access the functions you need using Ruby's Win32API dll access as explained in the User Guide. It takes some time to set them up, but then you are able to do those on-the-fly conversions.
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: change image to grayscale on fly

Postby Nubeat7 » Thu Apr 02, 2015 8:32 pm

there is also the color matrix, you can use this for changing colors of images.
User avatar
Nubeat7
 
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna

Re: change image to grayscale on fly

Postby Youlean » Thu Apr 02, 2015 8:59 pm

Try this... (It is not mine pack)
Attachments
gui pack.fsm
(31.31 KiB) Downloaded 797 times
Youlean
 
Posts: 176
Joined: Mon Jun 09, 2014 2:49 pm

Re: change image to grayscale on fly

Postby Logado » Fri Apr 03, 2015 5:25 am

Thanks for answers.
I need it to show that the element is not active. Make a simple method.

v.drawBitmapSection @Spriteimg,[0,image_y,48,16],[0,0,6,2]
if @disable == 1
c1 = Color.new 180,53,60,70 #background color
c1 = Color.new 180,53,40,70
r = [0,0,v.width,v.height]
b = LinearGradientBrush.new r,c1,c2,0,true
v.drawRectangle b,r
end
Logado
 
Posts: 62
Joined: Tue Jan 06, 2015 5:42 pm


Return to General

Who is online

Users browsing this forum: No registered users and 105 guests