Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Code Samples & Tips > Additional Libraries
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.


ImageLibEx library


Reply
 
LinkBack Thread Tools Display Modes
  #151 (permalink)  
Old 02-19-2010, 05:40 AM
Newbie
 
Join Date: Jun 2009
Posts: 7
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Really appreciate for the great library...

It would be nice when support GradientFill for Circle... It will be helpful for bullet/button design on bList.

Reply With Quote
  #152 (permalink)  
Old 02-19-2010, 08:16 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 3,839
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

If you are looking at it on the desktop it is because Basic4ppc doesn't get the desktop client area the correct size. This is a long-standing bug that (I hope) Erel will fix with the next release.

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.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.

Last edited by agraham : 02-19-2010 at 01:35 PM.
Reply With Quote
  #153 (permalink)  
Old 02-19-2010, 10:06 AM
Newbie
 
Join Date: Jun 2009
Posts: 7
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Quote:
Originally Posted by agraham View Post
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.
I see. It's a known bug.....

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
Would be nice to have feature.

Thanks again for the kindness.
Reply With Quote
  #154 (permalink)  
Old 02-19-2010, 03:36 PM
derez's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Posts: 604
Awards Showcase
Beta Tester Competition Winner 
Total Awards: 2
Default

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
Attached Images
File Type: jpg Gcircle.jpg (20.3 KB, 4 views)
Attached Files
File Type: zip Circle.zip (27.7 KB, 7 views)
__________________
David Erez
Ramat Hasharon, Israel

Last edited by derez : 02-19-2010 at 03:44 PM.
Reply With Quote
  #155 (permalink)  
Old 02-19-2010, 04:03 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 3,839
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

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.
Reply With Quote
  #156 (permalink)  
Old 02-19-2010, 08:02 PM
derez's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Posts: 604
Awards Showcase
Beta Tester Competition Winner 
Total Awards: 2
Default

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:
The attached modified library
I'm sorry that it looked foul to you.

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.
Reply With Quote
  #157 (permalink)  
Old 02-26-2010, 06:42 AM
ceaser's Avatar
Basic4ppc Veteran
 
Join Date: May 2008
Location: Paarl, South Africa
Posts: 278
Default

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
Reply With Quote
  #158 (permalink)  
Old 02-26-2010, 06:51 AM
ceaser's Avatar
Basic4ppc Veteran
 
Join Date: May 2008
Location: Paarl, South Africa
Posts: 278
Default

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
Reply With Quote
  #159 (permalink)  
Old 02-26-2010, 08:22 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 3,839
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

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.
Reply With Quote
  #160 (permalink)  
Old 02-26-2010, 09:01 AM
klaus's Avatar
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Switzerland
Posts: 1,797
Awards Showcase
Forum Contributer Beta Tester Competition Winner 
Total Awards: 3
Default

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)
x1,y1 and x2,y2 are the coordinates of the 2 corner points of the rectangle.

Best regards.
__________________
Klaus
Switzerland
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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


All times are GMT. The time now is 11:40 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0