|
-
Nov 12th, 2002, 01:17 PM
#1
Thread Starter
yay gay
alpha blending
i have a picturebox with an image loaded..and i want that when i click a button an alpha rectangle is drawn into that picturebox making the image a slight darker(or lighter)..any examples around there plz?
-
Nov 12th, 2002, 04:18 PM
#2
Thread Starter
yay gay
-
Nov 12th, 2002, 04:47 PM
#3
Hyperactive Member
Just set the color to be drawn from the FromARGB() method. Set the A to the desired transparency. I think RGB values would be 0 to darken the image and 255 to brighten it.
From there, you just draw a rectangle with this color onto the image.
-scott
he he he
-
Nov 12th, 2002, 06:37 PM
#4
Thread Starter
yay gay
yea but rectangles only support brushes and brushes dont have fromArgb()
-
Nov 13th, 2002, 01:14 PM
#5
Hyperactive Member
PHP Code:
// Create the transparent color
transparentFillColor = Color.FromArgb(transparency,fillColor);
...
Graphics g = e.Graphics;
// Draw the transparent rectangle on the graphics object
g.FillRectangle(new SolidBrush(transparentFillColor), (Rectangle)rectangleList[Index]);
BTW you could combine line 1 and 3 if you needed.
-scott
he he he
-
Nov 13th, 2002, 03:21 PM
#6
Thread Starter
yay gay
-
Nov 15th, 2002, 02:59 PM
#7
Hyperactive Member
-scott
he he he
-
Nov 15th, 2002, 03:15 PM
#8
Thread Starter
yay gay
i suck
u rule
explicit enough? lolol
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
|