Articles 3D Audio Custom Controls General RB Graphics Hacks Mac OS X Menus Novelty Printing REALbasic 2005 REALbasic 2006 Registration Resources Reviews Serial Speech Sockets XML Video Resource Links News Current News February 2006 January 2006 December 2005 November 2005 October 2005 September 2005 August 2005 July 2005 June 2005 May 2005 April 2005 March 2005 ![]() REALbasic for Dummies by Erick Tejkowski ![]() Learning REALbasic through Applications REALbasic for Macintosh REALbasic Cross-Platform Application Development
Older files are in Stuffit 5 or greater format. Newer files are ".Zip". Download StuffIt Expander |
|
What would Valentine's Day be without a valentine from your friends at ResExcellence? This week we'll look at how to make an electronic valentine with REALbasic.
Build the Interface Launch REALbasic, open Window1, and add a Canvas and Timer control to the window. Give the Canvas dimensions of 202 x 196. Set the Timer's Mode to a value of 2 and Period to 500. Download this flickerFreeCanvas class and drag it into your project. Then, change the Super property of the Canvas in Window1 to flickerFreeCanvas. Next, create a black and white image of a heart shape. If you aren't a good artist, you can download one here. Drag the image into your REALbasic project. Note that the image file I am using for this example is named "heartblack". Add the Code Double click Window1 to open its Code Editor. Select Edit-New Property and create a new picture property, named p. Finally, navigate to the Action event of Timer1 and add this code dim c as colordim r,b as integer r = rnd*255 b = rnd*100 p=newpicture(202,196,32) p.graphics.foreColor=rgb(r,0,b) p.graphics.fillrect 0,0,202,196 p.Mask.Graphics.DrawPicture heartblack,0,0 Canvas1.mPicture = p Canvas1.Redraw Conclusion You can download the finished product if you don't feel like recreating the project. Happy Valentine's Day and see you next week! |
||||
|
||||||||||||||||||||||||||||||||
Maintained by the Staff of ResExcellence. This entire site ©1997-2006 ResExcellence
Privacy Statement? Sure we gotta Privacy Statement.
[an error occurred while processing this directive]