|
-
Aug 30th, 2021, 05:55 AM
#41
Re: [RESOLVED] picturebox upsidedown-gradient
If you take the former example:
Pat.AddColorStop 0.7, vbRed
Pat.AddColorStop 0.99, vbGreen
Pat.AddColorStop 1, vbBlue
Then the opposite direction would be this:
Pat.AddColorStop 0.3, vbRed ' = 1 - 0.7
Pat.AddColorStop 0.01, vbGreen ' = 1 - 0.99
Pat.AddColorStop 0, vbBlue ' = 1 - 1
Olaf
-
Aug 31st, 2021, 08:51 AM
#42
Addicted Member
Re: [RESOLVED] picturebox upsidedown-gradient
 Originally Posted by Schmidt
If you take the former example:
Pat.AddColorStop 0.7, vbRed
Pat.AddColorStop 0.99, vbGreen
Pat.AddColorStop 1, vbBlue
Then the opposite direction would be this:
Pat.AddColorStop 0.3, vbRed ' = 1 - 0.7
Pat.AddColorStop 0.01, vbGreen ' = 1 - 0.99
Pat.AddColorStop 0, vbBlue ' = 1 - 1
Olaf
Actually, I made addendums to my original message, in the form of 2 separate 'Edit's (Edit and Edit-2) and a Note at the end. From your answer, I get a feeling that you have tried to answer my original message only and not my addendums. If so, I kindly request you to see my addendums too and kindly please help me out.
Kind regards.
-
Aug 31st, 2021, 11:46 AM
#43
Re: [RESOLVED] picturebox upsidedown-gradient
 Originally Posted by softv
Actually, I made addendums to my original message, in the form of 2 separate 'Edit's (Edit and Edit-2)...
Ok - to answer the "Angle-Param"-question first.
As it currently is, with the procedure-signature:
Sub RenderToFormOrPicBox(Canvas, AngDeg0to90, ColorStops)
... it will always be insufficient, in describing where exactly the Gradient-Vector starts, and where it ends.
Much better would be, to give the start- and end-coords of the Vector instead explicitely like:
Sub RenderToFormOrPicBox(Canvas, X0, Y0, X1, Y1, ColorStops)
... then passed directly into the Cairo.CreateLinearPattern- Constructor-Method.
As for regfree usage of the RC5 or RC6-libs, just use the (top-centered here) Google-Searchbox with the terms:
[RC5 regfree] or [RC5 regfree Olaf]
And you should find appropriate articles and threads pretty fast (same goes for [Cairo Rotate] or [Cairo Gradient], whatever).
HTH
Olaf
-
Sep 4th, 2021, 05:28 AM
#44
Addicted Member
Re: [RESOLVED] picturebox upsidedown-gradient
 Originally Posted by Schmidt
Ok - to answer the "Angle-Param"-question first.
... .. . Much better would be, to give the start- and end-coords of the Vector instead explicitly like:
Sub RenderToFormOrPicBox(Canvas, X0, Y0, X1, Y1, ColorStops)
... then passed directly into the Cairo.CreateLinearPattern- Constructor-Method.
HTH
Olaf
I really did not know how to instantly find out the "x,y" starting and ending coordinates for different angles for a given box of w*h
So, I drew a rectangle of 70*21 (My picturebox was 700*210) on paper and manually rotated the rectangle 45deg on (0,0) point upwards and downwards. Then, rotated the rectangle 45deg on the midpoint of the rectangle's diagonal. Tried with the "x,y" coordinates of start/end points obtained in each case for two colors (with stops at 0.5 and 1). Results were accurate but only if I changed the 2nd stop to 0.95. Well, it may be because the "x,y" coordinates I obtained were approximations only.
Well, for a given box of w*h, I wonder whether there is any way to obtain the "x,y" coordinates instantly for any angle and pass the same to the Cairo.CreateLinearPattern method. Anyway, I just did all the above to somehow see that I can get the gradient to display accurately in your Cairo with the "x,y" manual values. Otherwise, giving just the angle would be the ideal and best option for me. Having said that, once again I thank you ever-so-much for your instant help at all times.
Kind regards.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|