Results for "Author: lavolpe"
Do you need to draw a large gradient area during window resizing? The slowness! Maybe an answer is to draw faster in poorer quality then when done sizing (i.e., Button Up), redraw in fine quality. The attached sample, if nothing else, is a good routine for drawing gradients between 2 colors. The extra code in the routines allows user-supplied quality values which when used with the example can show a dramatic decrease in the number of loop iterations required to draw in the different qualities/roughness. RePosted: Reworked calcs to account for the uneven left/right edges of thick lines.
A sneaky way to have your program pause for a window to close (Modal) without disabling your project (non-Modal). Uses subclassing & hooks with 0% cpu usage. So the Do:DoEvents:Loop not used which hogs 95% CPU time. Can be used for all-API windows or standard VB windows. Heavily commented too.
Part 1. Prequel to a full-blown skinning application. This part does not skin but attempts to completely control the window non-client area. Provided in hopes you will help identify any bugs on different O/Ss. Works well on 98/2K. The other parts of this project will be submitted after bugs fixed in this part and feedback has been addressed. Part 2 will be skinned version compatible with MDIs, Part 3 will include routines for custom-drawn menus. Heavily subclassed and heavily commented; but still a work in progress. Feedback is definitely requested especially pertaining to bugs and suggestions.
While back I posted something like: 2 new borders for your picture boxes. Well how about 13 more? Trying to get a handle on the pixel measurement of borders, I was sometimes off by a pixel & couldn't figure out why. You know 1+3 should = 4, but interesting 'nuf thickframe(3)+staticedge(1)=2 and not 4. Anyway, if you wanted to know...
A tile blt'er with some added options. Out performs against CreatePatternBrush & may out perform most on PSC. Options include staggered alternating rows, tile over image, & can use transparent gifs, icons & cursors.
It appears this VB function can easily replace APIs like BitBlt, StretchBlt, DrawIconEx and others. So how do you use this function that no one seems to use? Included are a few ideas and "how to's". Hoping others more knowledgeable will add positive comments so others can learn too. Zip updated to include sample of portion Rendering. No BitBlt API used at all in examples.
Create a cool 3D shape from a 2D region. See screenshot which pretty much says it all. The direction of the 3D shape is hardcoded at 45deg angles. If you choose, you can modify to allow any angle. Updated to include sample of blt'ing an image over the plain shape.
How do you change the icon that appears in the Alt+Tab window? This is nothing new can be found on MSDN. The notes I added here are of interest. More info for skinning forms. Changing a form's icon doesn't affect the Alt+Tab window; you need to change the icon in an upper level, hidden window. Code below shows how. Notes to keep in mind.... The icon does NOT have to be one assigned to a form! If not, the only thing to remember is to cache that icon handle and don't destroy it until your application closes or you reassign using the same code below. Should you not cache the icon, and it is destroyed, the Alt+Tab will show a "blank/invisible" icon instead.
Asked how I might make a transparent frame or picture box? After a moment of wondering why, I realized that was a neat idea & one solution provided; there are more but this doesn't use custom controls. Would give credit to the person for the idea, but when he commented it was by a "No-Namer". Idea isn't mine; just the routines.
Don't have API Viewer freeware program? Don't bother downloading this. However, should you need or want to parse the API Viewer apv files from your code, a module is included in the zip. The parsing engine is fast & pretty well designed. The included interface to show a way of using the engine is not finished & no plans on finishing it. Required: API Viewer *.apv files (not included in zip)
Not your ordinary GIF viewer. Recognizes encoded animation loops, allows you to modify settings on the fly. With little effort, you can make the control appear transparent (screenshot), force transparency on non-transparent GIFs, skip frames, shift frames & a host of other options. A little unique in the fact that it does not use arrays of pictures, nor does it write the frames to a file. Putting this one on the backshelf for a couple months unless someone finds a serious bug or proposes a super idea/suggestion for improvement. Download the included GIFs into the same folder. You can get rid of them later, but project won't run without them. Last Updated: 11 Apr/14:35. Added cropping option to control & 2 more examples on the Test project. Tweaked ShowFrame routine. 12 Apr/10:40 Tweaked GetCustomBkgDC so users don't need to remember to stop animation b4 updating custom background to avoid leaks. Added BorderWidth & BorderHeight read only properties.
A usercontrol that mimics the selection/sizing tool like VB & MS Paint. It is a little unique, is flexible, and works well. Developed for a skinning engine I'm creating. I think it is pretty much done & offer it to you to play with. Read the remarks please. It isn't that big of a project.
Maybe the last color selector you will ever use? You supply a dummy/empty form & the code does the rest. Lots of options & will list most of them here: 1) 3 palettes to choose from, 2) palette tabs can be disabled, 3) grab color from anywhere on screen, 4) fail-safe mode will display std color dialog if routines fail, 5) mouse wheel support, 6) prevent non-palette selections, 7)auto-convert negative sys colors to positive values, 8)add custom colors to the default palette or replace completely, 9) easy window placement, 10) even more options. Heavily documented, jump to end of the module for a detailed description of options & their settings. Feedback works ladies & gents... that's why this new version is up on PSC. Last Updated: 7 Apr/1630 CST - Critical flag wasn't always being reset - could cause picker to show up as a plain gray window.
Complete repository for all of your code. Include attachments, web links, shortcuts to other apps, organize on user-defined categories, searchable database, want to keep track of who gave you feedack? No problem. Copy and paste into your project, extract routines from existing projects. Share database entries with its Import/Export function. Help file included. If you use this one, you won't need another.
Awesome calendar that validates user-selected dates for you so your code doesn't have to. Called by 1 line of code. International aware, define your own holiday/events -- see samples in code, testing form provided. Please read the comments in the code. Enjoy. Included are generic date functions, mouse & window positioning functions. Re-Post. The last version posted was not the current version.
Just a tool. Create animated bitmaps from animated GIFs. Result is also transparent when used with module provided. Several neat options. Code combined from MSDN, VB_Thunder and some creativity on my part to use in a game I made for my son. Commented but could still be hard to follow. Have fun with it. Two play GIFs provided.
Updated. Game--Battleship in space. A few twists on the original battleship like shields, scanning devices, cloaking. Play against another person or computer. A speed-play Salvo game option also. Built for my son, he thought it was awesome. Maybe yours would like it too. This update enables computer as opponent in all the games now. Part II has the optional WAV files (too big for one posting). Get Part II at http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=40635&lngWId=1
Used to view huge files. I use daily to review last 1mb of 30+ meg files. Loads only portions of a file (by chunk size or percentage) instead of entire file & is quick. Feel free to use & abuse as you like.
Reusable form. Offers selection of trusted ODBC connections (system DSNs only) that are configured on a workstation. Results are ODBC DSN name and type of connection. Short & sweet. Looking for something your customer only has to click on, this is it -- no manual entry required.
A fun project -- magnifying glass. Can be used as is, but presented more for ideas. Fully commented and please read the main form's remarks before posting and ideas. Thanx in advance.