DarkenImage command

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
marcoagpinto
Addict
Addict
Posts: 1045
Joined: Sun Mar 10, 2013 3:01 pm
Location: Portugal
Contact:

DarkenImage command

Post by marcoagpinto »

Hello!

Based on the tips from a forum user, in a topic I created days ago, I created the following procedure:

Code: Select all

; Darken Image procedure, based on the source code from the PB forum
; Image Number, Darken %
;
; V1.0 - 1/FEB/2016
;
Procedure DarkenImage(image_number,darken_percent)
  StartDrawing(ImageOutput(image_number))
  DrawingMode(#PB_2DDrawing_AlphaBlend)
  Box(0, 0, ImageWidth(image_number),ImageHeight(image_number), RGBA(0, 0, 0, 2.5*darken_percent))     
  StopDrawing()  
EndProcedure
I was wondering if Freddy could create such a command to remove the need to have a procedure.

Thanks!

Kind regards,
>Marco A.G.Pinto
---------------
User avatar
Bisonte
Addict
Addict
Posts: 1305
Joined: Tue Oct 09, 2007 2:15 am

Re: DarkenImage command

Post by Bisonte »

marcoagpinto wrote: I was wondering if Freddy could create such a command to remove the need to have a procedure.
Because it's small, simple and specific.
It's the same like Min() and Max() functions.
PureBasic 6.21 (Windows x64) | Windows 11 Pro | AsRock B850 Steel Legend Wifi | R7 9800x3D | 64GB RAM | RTX 5080 | ThermaltakeView 270 TG ARGB | build by vannicom​​
English is not my native language... (I often use DeepL.)
infratec
Always Here
Always Here
Posts: 7588
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: DarkenImage command

Post by infratec »

Hi,

do you want a 'marcoagpinto Basic' :?:

If I send all my small procedures to Fred to include them as native stuff
PB grows a lot :mrgreen:

Simply put all your small procedures in one pbi file and include it in each of your programs.
This has the same effect.

And if you want that it is usable by others: provide a download link.

Bernd
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: DarkenImage command

Post by IdeasVacuum »

Hi Marco

This is what you need:
ColorEffex - Module
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Post Reply