Version 2.1 now posted includes support for individual pixel alpha values so you can now blend images with alpha values, such as PNGs, and get proper transparency. See the "Alpha blending overview" in the gelp.
Retire early and keep body and mind activeAny secrets you may share with us "normal human beings" to benefit from?
Gradient fill for circle is a nice idea but I'm afraid it is not supported on the device. It is possible on the desktop so I might look at putting it in my GDI+Desktop library.
iRad = 20
fct1 = Ln(iRad)/255
For i=iRad To 1 Step -1
'1.7 to 0
cR1 = Int(Ln(i)/fct1)
cR2 = 255-Int(Ln(iRad+1-i)/fct1)
'Msgbox("Calculated Log(" & i & ") = " & cR1 & CRLF & cR2)
brs.Color = Rgb(cR1,0,0)
drw.FillCircle(brs.Value, xCtr-50, yCtr-50, i)
brs.Color = Rgb(cR2,0,0)
drw.FillCircle(brs.Value, xCtr+50, yCtr-50, i)
Next
Sub App_Start
Form1.Show
pen.New1(cBlack)
dr.New1("form1",False)
dr.GradientCircle(100,100,50,cYellow,cBlue)
dr.drawCircle(pen.Value,100,100,50)
End Sub
The attached modified library
public void GradientCircle( int x, int y, int radius, int startcolor, int endcolor)
{
System.Drawing.SolidBrush brush = new System.Drawing.SolidBrush(Color.FromArgb(endcolor));
Color sc = Color.FromArgb(startcolor);
Color ec = Color.FromArgb(endcolor);
int rc = (sc.R - ec.R)/radius;
int gc = (sc.G - ec.G)/radius;
int bc = (sc.B - ec.B)/radius;
for (int i=radius;i>0;i--)
{
System.Drawing.Rectangle rect = new System.Drawing.Rectangle(x - i, y - i, i * 2, i * 2);
brush.Color = Color.FromArgb( ec.R + rc*i, ec.G + gc*i , ec.B + bc*i);
g.FillEllipse(brush, rect);
}
}
[FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]x0=[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]Min[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2](x1,x2)[/SIZE][/FONT]
[SIZE=2][FONT=Courier New]y0=[/FONT][/SIZE][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]Min[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2](y1,y2)[/SIZE][/FONT]
[SIZE=2][FONT=Courier New]w=[/FONT][/SIZE][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]Abs[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2](x2-x1)[/SIZE][/FONT]
[SIZE=2][FONT=Courier New]h=[/FONT][/SIZE][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]Abs[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2](y2-y1)[/SIZE][/FONT]
[SIZE=2][FONT=Courier New]drwMain.DrawRectangle2(pen1.Value,x0,y0,w,h)[/FONT][/SIZE][/SIZE][/FONT]
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?