Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Pedro Estarque

macrumors regular
Original poster
Dec 5, 2002
131
0
I'm learning basic and just built my first app, :D I've developed a small GUI for a BSD shell script that uses lynx in OS X. Although very simple, is quite useful for authentication in Brazilian's broad band web site. The program works fine but the interface need's polishing.
It must be a very stupid question but do you know how to apply masks to images in realbasic ? The only thing I can do is apply a white transparency (in the properties window), but that has no anti-aliasing and the result is very bad.
Any help is appreciated
 
Congratulations on building your first RB app. I'm guessing you are putting the image in a Canvas control. If not this is probably the way you want to do it.

Within the canvas class is a Paint event with the parameters g as Graphics. You must draw the image to this graphics object. First you must create a picture object with your mask and image in it. Like this:

dim p as Picture
p = NewPictrue(width, height, depth)
p.Mask = MyMaskName
p.Graphics.DrawPicture(MyImageName, 0, 0)

Then finally the picture must be drawn to the graphics object g.

g.DrawPicture(p,xPosition,yPosition)

I think that should do it, although I must confess I haven't done it before. You may want to join the RB mailing list, which is composed of extremely knowledgeable people, who are still willing to help just about anyone. You can subscribe at this address: http://www.realbasic.com/support/lists.html

Depending on who the target of this app is, you may want to consider not using the image in the interface. Many users prefer to have a unified interface without company logos etc. If this is for an about box, though, it is perfectly acceptable. You may want to read apple's Aqua Human Interface Guidelines, available on apple's site, somewhere.
 
benjaminpg, sorry to bother

I don't know what I did wrong but RB asks for the value for the function mask. Any Ideas?
Thanks again
 

Attachments

  • bug.jpg
    bug.jpg
    19 KB · Views: 333
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.