[Gambas-user] get the color from a pixel in DrawingArea control

Arief Bayu Purwanto ariefbayu at ...626...
Mon Mar 26 10:38:56 CEST 2007


Thank you for your solution, I'll check it out once I back home and
give report ASAP.

On 3/26/07, timothy <timothy.marshal-nichols at ...247...> wrote:
>
> > -----Original Message-----
> > From: gambas-user-bounces at lists.sourceforge.net [mailto:gambas-user-
> > bounces at lists.sourceforge.net] On Behalf Of Arief Bayu Purwanto
> > Sent: Sunday, 25 March 2007 10:43 AM
> > To: gambas-user at lists.sourceforge.net
> > Subject: [Gambas-user] get the color from a pixel in DrawingArea
> control
> >
> > Dear member,
> >
> > I'm trying to create a paint application. Right now I'm encounter a
> > problem when I want to aplly  a photo bucket tool. Because It's need
> > current color of a pixel to do the job. I'm searching around the help
> > document, but found nothing. Could someone in this forum help me out?
> > or give me proper search query in google so that I can find a heading.
> > or is it possible to do this?
> > Btw, I'm using gambas from ubuntu edgy repository.
> >
> > --
> > -- Yahoo!ID : ar1ef_310
> > -- http://bayu.freelancer.web.id/
> >
>
>
> Suppose you want to get the color of a point on a DrawingArea then:
>
> PUBLIC SUB DrawingArea_MouseMove()
>         DIM c AS Integer
>         c = DrawingArea.Grab().Image[Mouse.X, Mouse.Y]
>
>         ' Use color
> END
>
> Note two things. (1) Here color is an integer. (2) You might want to set
> the Tracking property of a DrawingArea to TRUE so you get mouse events
> without a button being pressed.
>
> In general to get the color of a point on a Image
>
>         c = MyImage[X, Y]
>
> and to get the color of a point on a Picture:
>
>         c = MyPicture.Image[X, Y]
>
> You can extend this idea to get the color of any point on the screen:
>
>         c = Desktop.Grab().Image[Mouse.ScreenX, Mouse.ScreenY]
>
> Thanks
>
> 8-{)} Timothy Marshal-Nichols
> <mailto: timothy.marshal-nichols at ...247...>
>
>
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>


-- 
-- Yahoo!ID : ar1ef_310
-- http://bayu.freelancer.web.id/ <= moving...
-- http://www.blogshares.com/?referer=28353




More information about the User mailing list