Can you see that it is a two coloured picture? Maybe with a magnifier!

Instead,

Take a look at the animation below simulating a 32:1 magnification of bg.bmp.A small 1x2, 2 pixel Bitmap file is stretched to an enormous size of 640x480 pixels to create the Gradient fill effect

That is it!

Notes:

[*:2m52mtfa]Create a 2 pixel bitmap (1 pixel wide and 2 pixel tall) for a Vertical Linear Gradient.[*:2m52mtfa]Create a 2 pixel bitmap (2 pixel wide and 1 pixel tall) for a Horizontal Linear Gradient.[*:2m52mtfa]Select the Top/Bottom (or) Left/Right colors. A bit of creativity is required.[*:2m52mtfa]Now add it with "Gui, Add, Picture" command and use w & h options to stretch it to the required size.[*:2m52mtfa]This stretching creates the Gradient effect!

[*:2m52mtfa]Unique Gradients: (256*256*256) * (256*256*256) = ??? Never mind! I am poor in Mathematics. [*:2m52mtfa]You may also use the same technique to create colorful vertical / horizontal lines.

[*:2m52mtfa]If you do not have Active Desktop enabled, you may use these bitmaps as stretched Wallpapers.

[*:2m52mtfa]You will not be able to create these images with Paint.exe. An advanced Image editor will be required.I was using PaintShop Pro to create these Bitmaps. Now, I have my own BITMAP Gradient Maker.

[*:2m52mtfa]Important Styles that can be used with "Gui, Add, Picture"[*:2m52mtfa] E0x200 for Sunken Button effect.[*:2m52mtfa] 0x400000 for Raised Button effect.[*:2m52mtfa] Border to wear a thin black line around the Picture.[/list]Vertical Linear Gradients - Snapshots

Following are snapshots of 2 Pixel bitmaps stretched at 280x210 on a "Gui, -Caption" canvas. The Text seen on them are the pair of Hex Color Codes used to create them.----------

----------

----------

gb1.ahk is an example that simulates both Vertical and Horizontal Gradients.

Note: See the Pillars on the left/right side on the GUI. I have simulated a Horizontal Gradient effect

The following posts contains information on the visual effects seen in the snapshot.

[*:2m52mtfa]Param1: File name to be created[*:2m52mtfa]Param2: A Valid Hex Color code for the Bottom (or) Left pixel. ( in RGB )[*:2m52mtfa]Param3: A Valid Hex Color code for the Top (or) Right pixel. ( in RGB )[*:2m52mtfa]Param4:0 (or) 1 . Vertical=1 / Horizontal=0

[EDIT] I wrote non-sense!
Note that if you use AltSubmit, you won't have gradient, so this trick works mostly with BMP images (not a problem as these images are very small)!

Goyyah: I like this topic, but changing the subject makes hard to search the old sub-topics (where did I saw this text-with-shadow effect?). You don't have to change the way you manage it, but I wanted to draw attention to the problem.

I have been using outdated software . I tried stretching a 1x2 JPEG in a (table) cell (Dreamweaver 3) and it did not result in a gradient fill!.Even as a Stretched Wallpaper, it did not display a gradient fill with Active Desktop enabled.

@Goyyah: I wasn't clear in my remark on the topic: when I wrote "Where did I saw this text-with-shadow effect?", it is the kind of question I ask myself when I take a quick look at the list of topics in the Scripts & Functions section or even in a Search result! Hence the remark.

@Titan: It seems that Goyyah tried to put something like <img src="Images/2pixelsH.bmp" width="100" height="100" /> in an HTML file and got two distinct colors.Note that SVG is already supported (perhaps only partially) by Firefox 1.5.

I wasn't clear in my remark on the topic: when I wrote "Where did I saw this text-with-shadow effect?", it is the kind of question I ask myself when I take a quick look at the list of topics in the Scripts & Functions section or even in a Search result! Hence the remark.

I get it now! .

Please wait for the Part 2. I will be requiring your valuable opinion.

[EDIT] I wrote non-sense!Note that if you use AltSubmit, you won't have gradient, so this trick works mostly with BMP images (not a problem as these images are very small)!

Yes! I just noticed :shock:. I was not interested in JPG - because for this particular resolution (1x2) , BMP was sized @ 62 byes whereas JPG was 512 bytes. Also the file format of [b]BMP is very simple and we could easily create one dynamically.

HI - I really liked your Linear Gradient work. It is very very nice and professional. Can you please describe or even show me if you feel happy to oblige - to how I can start with a basic AHK script using this concept. The idea I have is a gradiant square like yours between any two color values. It should be a square I can define the (w)idth and (h)eight to. I would like to basically start with a play values like:

Great looking code. May I ask, how this could be tweaked to do two things:

1) Have a var_input = %, so the 50% is flexible

2) To turn this into a callable function, so the display is updated when the function is called. I envision something like UpdateGraph(var_width, var_height, var_start_color, var_end_color, var_input). I don't know how piped in variables/functions perciely work under AHK (I can think JavaScript :-). This is really giving me quick-ramp up to its protocols so I apprecaite your descriptions so much. So I would envision this to be called like UpdateGraph(250,250,0208FF,FFFFFF,50%) <- I know that is wrong all-together, but u get the idea I hope

That will make it real flexible, simple and modular. Hopefully you think that is right software protocol.

No. That is not possible CreateBMPGradient()! That function has been hardcoded to create a 2 pixel bitmap. Each pixel will occupy half the control 50:50. If you want 33:66, then the function has to re-written to accomodate 3 pixels. Say for blue n black it would be blue+black+black, and effectively blue would occupy 33.33% and black 66.66%

Hope you get that right.

2) To turn this into a callable function, so the display is updated when the function is called. I envision something like UpdateGraph(var_width, var_height, var_start_color, var_end_color, var_input).

Writing such a wrapper function id redundant, IMHO. Just assign a variable (like MyPic ) to the picture control and call the GuiControl command to change the picture ( or its dimension )

I am trying to cram this all in my head, but do follow your logic soundly!

two questions -

What does 1 signify?
% CreateBMPGradient("bg.bmp","000000","FF0000",1) < what is 1?

Can this be further explored, the idea to have a % input - to basically have a BMP assignment, for 1%, 2% to 100%. Just 1-100 to keep it simple. Each one has a mathamatatial computation to some BMP configuration, then its pumped into BMP.

I am way way over my head actually writing it out, but maybe if I can see some ways you write, I can follow the rythum for improving this object. I have some other ideas to make this more interesting, like a decay? -- so if a 16% was pumped in, then a 42% three seconds later, it will kick back up, but not in a fast skippy way. Kinda like a very nice car stereo equalizer.... so it look real smooth, remain live and programmable. Do you see where I am going with this? I think it will be fun to mess around with.

What does 1 signify?% CreateBMPGradient("bg.bmp","000000","FF0000",1) < what is 1?

1 creates a vertical stack of two pixels whereas 0 creates a horizontal one.The parameters have been explained in the original post.

Can this be further explored, the idea to have a % input - to basically have a BMP assignment, for 1%, 2% to 100%. Just 1-100 to keep it simple. Each one has a mathamatatial computation to some BMP configuration, then its pumped into BMP.

Well.. My function creates only a 2 pixel bitmap, which - when - stretched to abnormal limits - creates a gradient effect. It is a kind of simulation. For your requirements, You might have to create a full sized bitmap to achieve proper results which is beyond the scope of CreateBMPGradient() function.

I will give it a try when I have time and post again.

Regards,

PS: Sorry for the late reply. Offlate, I have not been frequenting the forum.