![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Additional Libraries Users contributed libraries. This sub-forum is only available to licensed users. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Quote:
I simulated it by changing radius and Fill color of the circle consecutively and it worked on device... Code:
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
Thanks again for the kindness. |
|
||||
|
The attached modified library will draw a gradient circle on desktop and device.
Make a penEx and DrawerEx objects. Code:
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
__________________
David Erez Ramat Hasharon, Israel Last edited by derez : 02-19-2010 at 03:44 PM. |
|
||||
|
If you are going to take my source codes, change them, recompile them and then publish them you might at least have the courtesy to change the names to avoid confusion and to also publish the amended source as well!
![]() There are certain conventions usually observed when making use of other peoples intellectual property.
__________________
Sorry, but I don't answer questions by PM or email. Please post your queries in the forum. |
|
||||
|
Agraham
Never meant to steal your property or to try to make it look as if I made it. As I have only recently started to work with libraries, I can only dream on writing such a library. I thought I made it clear that it is not my library by adding a post here (not as a new thread) and with this Quote:
![]() I didn't add the source because I didn't want it to replace your library, just to help seongjin. Here is the piece of code I added, you can use it or not - as you wish. Code:
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);
}
}
__________________
David Erez Ramat Hasharon, Israel Last edited by derez : 02-19-2010 at 08:22 PM. |
|
||||
|
Hi Agraham
![]() I am rewriting my CAD module using your library. Is it possible to add different line types to the rectangles as well please. When one draws a box on the screen to select drawing entities, then it would be nice to have this box as dashed lines. Regards Michael |
|
||||
|
Hi Agraham
Something else. Is it please possible to introduce another "Rectangle" method by defining the two opposite corners of the rectangle? The reason why I ask this, is because the user of the CAD program can define a rectangle using the stylus from left to right, right to left, from top to bottom, bottom to top, etc. Thanks for a great library ![]() Regards Michael |
|
||||
|
In the Compact framework there is no intrinsic way of drawing a rectangle by specifying its' co-ordinates. Rather than synthesising it within the library I would suggest that you make your own version in a module.
You should be able to draw a dashed rectangle on the device using a PenEx with DashStyles set to 1. The Compact Framework only supports a single dash style so if you want something different I again suggest that you roll your own using using DrawLineDashed or DrawLineDashDot.
__________________
Sorry, but I don't answer questions by PM or email. Please post your queries in the forum. |
|
||||
|
Hi Michael,
I have used this workaround: Code:
x0=Min(x1,x2) y0=Min(y1,y2) w=Abs(x2-x1) h=Abs(y2-y1) drwMain.DrawRectangle2(pen1.Value,x0,y0,w,h) Best regards.
__________________
Klaus Switzerland |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Merging Outlook library and Phone library | Erel | Official Updates | 4 | 01-01-2010 09:18 AM |
| Door library (Beta) - Special library | Erel | Official Updates | 52 | 12-08-2008 05:03 PM |
| PhoneticAlgorithms Library (ex-StringComparison Library) | moster67 | Additional Libraries | 10 | 11-11-2008 07:46 PM |
| ImageLibEx? | agraham | Basic4ppc Wishlist | 2 | 11-05-2007 01:15 PM |
| ImageLibeX Error | XerVision | Questions & Help Needed | 8 | 08-27-2007 06:14 PM |