antialiasing line?

a6000000

Member
Licensed User
Longtime User
how can we draw lines , like in pChart, with AntiAliasing ?
I know with flash it is possible, but with basic4ppc?
so Ithink about to draw with double size- save a double sized bitmap- then load a half scaled image :(
or: http://bytes.com/topic/visual-basic-net/answers/356202-antialiasing-drawline-possible ??
see: Chart pchart - Welcome
attachment.php
 

Attachments

  • diagram-pchart-qq66yydiagram-render-1.jpg
    diagram-pchart-qq66yydiagram-render-1.jpg
    18.9 KB · Views: 381
Last edited:

agraham

Expert
Licensed User
Longtime User
The Compact Framework on the device does not support smoothing.

On the desktop you can invoke it in the ImageLib Drawer or ImageLibEx DrawerEx objects by using the Door library.
B4X:
Sub App_Start
   Form1.Show
   Drawer.New1("Form1", False)
   Pen.New1(cBlack)
   Pen.Width = 1
   Obj1.New1(False)
   Obj1.FromLibrary("Main.Drawer", "g", B4PObject(2))
   ' 0 Default : 1 : HighSpeed : 2 HighQuality : 3 None : 4 AntiAlias
   For i = 0 To 4
      Obj1.SetProperty("SmoothingMode", i)   
      Drawer.DrawLine(Pen.Value, 0, i * 10, 200, 100 + i * 10)
   Next
End Sub
Obj1 is a Door library Object. Pen is a Pen or PenEx and Drawer is a Drawer or DrawerEx.
 

a6000000

Member
Licensed User
Longtime User
=_pChart800bgSCREEN.png


'// I found 3colors per line and draw each line 3times and so I like it :)

'///////////////////////////////////////
'// my colors
'yellow1
colr14=Rgb(138,129,148)
colr13=Rgb(182,177,119) '(218,216,100)
colr11=Rgb(242,241,87)

'yellow2 ..lighter
'colr24=Rgb(112,106,82)
colr24=Rgb(132,136,62)
colr23=Rgb(158,166,52)
colr21=Rgb(196,193,41)

'green1
colr34=Rgb( 49,136,155)
colr33=Rgb(136,186,156)
colr31=Rgb(158,249,159)
'green2
colr44=Rgb(74 ,129,114)
'colr43=Rgb(65 ,146, 92)
colr43=Rgb(65 ,176, 92)
colr41=Rgb(46 ,226, 43)

'red1
colr54=Rgb(147,115,151)
colr53=Rgb(190,136,150)
colr51=Rgb(234,156,149)
'red2
colr64=Rgb(149,59,91)
colr63=Rgb(191,61,76)
colr61=Rgb(220,50,51)

'colores func LinAAlise{}
colr4=colr14 ''Rgb( 49,136,155)
colr3=colr13 ''Rgb(136,186,156)
colr1=colr11 ''Rgb(158,249,159)


'///////////////////////////////////////////
pen1.Color=colr4
pen1.Width=4
drwImage.DrawLine(pen1.Value,xx1,yy1,xx2,yy2)
pen1.Color=colr3
pen1.Width=3
drwImage.DrawLine(pen1.Value,xx1,yy1,xx2,yy2)
pen1.Color=colr1
pen1.Width=1
drwImage.DrawLine(pen1.Value,xx1,yy1,xx2,yy2)
 
Last edited:

Byak@

Active Member
Licensed User
very interesting code! what about converting it for b4ppc?
 
Top