Results for "Author: tanner h"
There's not a single program on all of psc that shows how to correctly adjust an image's contrast....at least, there *wasn't.* This simple program demonstrates how to easily adjust an image's contrast based on a -100 to 100% scale. Simple and fast.
Many VB programmers don't understand the graphics capabilities of Visual Basic when you use basic API calls. This (and a series of forthcoming tutorials) will explain the basics of getting and setting pixels using both VB and the Windows API (via SetPixel, SetPixelV, and GetPixel), as well as using the API to set pixels on objects other than picture boxes (such as command buttons, frames, etc.).
Here's a simple demo of how to program basic physics for a flying object (like a space ship or something). It demonstrates physics for a primary object (the ship) and secondary objects (the bullets), and as always it's simple and well-commented, as well as running at 40 fps or faster. This is basically a revamped version of the Return of the Avenger game engine -also on psc- so download that to see this code actually used in a game.
Sorry to everyone for re-uploading this as "new"...somehow the old .zip got lost in the moderation. Anyway, for those who don't know - these tutorials cover all aspects of per-pixel interfacing in VB. Included in the tutorial are sections on Point/PSet, Get/SetPixel/V, Get/SetBitmapBits, and Get/StretchDIBits. Speed comparisons and an extra page on general graphics optimizations is included. The tutorials have been completely reformatted and updated with a new section on 4-bit alignment in DIB section width, as well as information on SafeArrays and graphics programming. Comments are welcome!
This is the first of its kind in VB: accurate, real-time image level adjustment. (This will be very familiar to any PhotoShop users among us :) Image Levels provide better control over an image's luminance than strict brightness/contrast methods (since they tend to distribute an image's histogram more equally). Adjusting an image using input/output/midtone levels is mainly used to brighten or darken an image without losing detail at either end of the luminance spectrum. I've included simple histogram drawing code (as the screenshot shows) so that you can see the effects that adjusting input/output/midtone levels has on an image's histogram. The code is well-commented and fast - please post comments and enjoy!
This little program was my final project for a university bioinformatics course. It is designed to represent basic evolutionary and population genetics principles for simple artifical organisms. Basically, simple creatures compete with each other for limited resources. Each organism has a strand of pseudo-DNA that determines three basic attributes: size, speed, and range (how far it can see). When the little critters reproduce (asexually - sorry, everyone :), mutations may take place in the child organism. The code isn't completely optimized, but you may still find that it runs too fast compiled. It can be quite addicting - my longest simulation ran for almost 400,000 cycles before all the organisms died out. For further analysis of a particular simulation, all data can be saved to a tab-delimited text file compatible with any major spreadsheet software. Comments and suggestions are welcome.
By request, here's another first of its kind in VB: a fast, accurate, real-time image curves dialog. (This should be familiar to the PhotoShop users among us :) Curves is similar in theory to my previous "Image Levels" post and standard gamma correction, but it provides a much more powerful interface for adjusting the luminance of an image. This project provides results very similar to Photoshop's, and it allows the creation of more spline knots (32 instead of 16). The cubic spline code on which I based my code was taken from Jason Bullen's excellent "Simple Cubic Spline Curve Plot" (http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=11488&lngWId=1). The code is well-commented and very fast - please post comments, requests for future Photoshop-related code, and many heaps of praise (as this was a complicated routine to sort out...)! Update 2/May/07 - disable loading of icons and warn the user against loading very large images.
There's not a single program on all of psc that shows how to correctly adjust an image's contrast....at least, there *wasn't.* This simple program demonstrates how to easily adjust an image's contrast based on a -100 to 100% scale. Simple and fast.
Many VB programmers don't understand the graphics capabilities of Visual Basic when you use basic API calls. This (and a series of forthcoming tutorials) will explain the basics of getting and setting pixels using both VB and the Windows API (via SetPixel, SetPixelV, and GetPixel), as well as using the API to set pixels on objects other than picture boxes (such as command buttons, frames, etc.).
Here's a simple demo of how to program basic physics for a flying object (like a space ship or something). It demonstrates physics for a primary object (the ship) and secondary objects (the bullets), and as always it's simple and well-commented, as well as running at 40 fps or faster. This is basically a revamped version of the Return of the Avenger game engine -also on psc- so download that to see this code actually used in a game.
Sorry to everyone for re-uploading this as "new"...somehow the old .zip got lost in the moderation. Anyway, for those who don't know - these tutorials cover all aspects of per-pixel interfacing in VB. Included in the tutorial are sections on Point/PSet, Get/SetPixel/V, Get/SetBitmapBits, and Get/StretchDIBits. Speed comparisons and an extra page on general graphics optimizations is included. The tutorials have been completely reformatted and updated with a new section on 4-bit alignment in DIB section width, as well as information on SafeArrays and graphics programming. Comments are welcome!
This is the first of its kind in VB: accurate, real-time image level adjustment. (This will be very familiar to any PhotoShop users among us :) Image Levels provide better control over an image's luminance than strict brightness/contrast methods (since they tend to distribute an image's histogram more equally). Adjusting an image using input/output/midtone levels is mainly used to brighten or darken an image without losing detail at either end of the luminance spectrum. I've included simple histogram drawing code (as the screenshot shows) so that you can see the effects that adjusting input/output/midtone levels has on an image's histogram. The code is well-commented and fast - please post comments and enjoy!
This little program was my final project for a university bioinformatics course. It is designed to represent basic evolutionary and population genetics principles for simple artifical organisms. Basically, simple creatures compete with each other for limited resources. Each organism has a strand of pseudo-DNA that determines three basic attributes: size, speed, and range (how far it can see). When the little critters reproduce (asexually - sorry, everyone :), mutations may take place in the child organism. The code isn't completely optimized, but you may still find that it runs too fast compiled. It can be quite addicting - my longest simulation ran for almost 400,000 cycles before all the organisms died out. For further analysis of a particular simulation, all data can be saved to a tab-delimited text file compatible with any major spreadsheet software. Comments and suggestions are welcome.
By request, here's another first of its kind in VB: a fast, accurate, real-time image curves dialog. (This should be familiar to the PhotoShop users among us :) Curves is similar in theory to my previous "Image Levels" post and standard gamma correction, but it provides a much more powerful interface for adjusting the luminance of an image. This project provides results very similar to Photoshop's, and it allows the creation of more spline knots (32 instead of 16). The cubic spline code on which I based my code was taken from Jason Bullen's excellent "Simple Cubic Spline Curve Plot" (http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=11488&lngWId=1). The code is well-commented and very fast - please post comments, requests for future Photoshop-related code, and many heaps of praise (as this was a complicated routine to sort out...)! Update 2/May/07 - disable loading of icons and warn the user against loading very large images.
There's not a single program on all of psc that shows how to correctly adjust an image's contrast....at least, there *wasn't.* This simple program demonstrates how to easily adjust an image's contrast based on a -100 to 100% scale. Simple and fast.
Many VB programmers don't understand the graphics capabilities of Visual Basic when you use basic API calls. This (and a series of forthcoming tutorials) will explain the basics of getting and setting pixels using both VB and the Windows API (via SetPixel, SetPixelV, and GetPixel), as well as using the API to set pixels on objects other than picture boxes (such as command buttons, frames, etc.).
Here's a simple demo of how to program basic physics for a flying object (like a space ship or something). It demonstrates physics for a primary object (the ship) and secondary objects (the bullets), and as always it's simple and well-commented, as well as running at 40 fps or faster. This is basically a revamped version of the Return of the Avenger game engine -also on psc- so download that to see this code actually used in a game.
Sorry to everyone for re-uploading this as "new"...somehow the old .zip got lost in the moderation. Anyway, for those who don't know - these tutorials cover all aspects of per-pixel interfacing in VB. Included in the tutorial are sections on Point/PSet, Get/SetPixel/V, Get/SetBitmapBits, and Get/StretchDIBits. Speed comparisons and an extra page on general graphics optimizations is included. The tutorials have been completely reformatted and updated with a new section on 4-bit alignment in DIB section width, as well as information on SafeArrays and graphics programming. Comments are welcome!
This is the first of its kind in VB: accurate, real-time image level adjustment. (This will be very familiar to any PhotoShop users among us :) Image Levels provide better control over an image's luminance than strict brightness/contrast methods (since they tend to distribute an image's histogram more equally). Adjusting an image using input/output/midtone levels is mainly used to brighten or darken an image without losing detail at either end of the luminance spectrum. I've included simple histogram drawing code (as the screenshot shows) so that you can see the effects that adjusting input/output/midtone levels has on an image's histogram. The code is well-commented and fast - please post comments and enjoy!
This little program was my final project for a university bioinformatics course. It is designed to represent basic evolutionary and population genetics principles for simple artifical organisms. Basically, simple creatures compete with each other for limited resources. Each organism has a strand of pseudo-DNA that determines three basic attributes: size, speed, and range (how far it can see). When the little critters reproduce (asexually - sorry, everyone :), mutations may take place in the child organism. The code isn't completely optimized, but you may still find that it runs too fast compiled. It can be quite addicting - my longest simulation ran for almost 400,000 cycles before all the organisms died out. For further analysis of a particular simulation, all data can be saved to a tab-delimited text file compatible with any major spreadsheet software. Comments and suggestions are welcome.