Important alert: (current site time 7/16/2013 3:17:17 AM EDT)
 

winzip icon

Advanced Graphics Routines 2.2 UPDATED **must see!**

Email
Submitted on: 2/17/2001 4:34:07 PM
By: Florian Egel  
Level: Intermediate
User Rating: By 57 Users
Compatibility: VB 4.0 (32-bit), VB 5.0, VB 6.0
Views: 72756
author picture
(About the author)
 
     If you want to adjust the brightness of a picture, rotate a picture with ANTI-ALIASING or AlphaBlend pictures together, maybe using an invisible mask color, and all that in vb and in just milliseconds... then you need this code! I wrote all the calculations in a C++ DLL, because it is much faster and easier to use, you just need a few lines of code to make incredible effects! in the zip-file there is the DLL and a VB-Demo to demonstrate the possibilities and the performance of my dll.

NOTE: Version 3.0 is released, go to http://www.planet-source-code.com/vb/scripts/showcode.asp?txtCodeId=21470

UPDATED! 2.0: The new package now also includes a VB-Only-Version with the functions from the dll rewritten for VB, so you can use the stuff without the dll! (though the dll is faster than the still fast VB-code, so i would use the dll). I also included a BUMP MAPPING routine a BLUR filter and an IMPROVED ALPHA BLENDING routine.

UPDATED! 2.1: Fixed a problem with 16 bit color depth. included MOSAIC filter.

UPDATED! 2.2: Added some nice, useful timer- and counter-functions. See demo for description. I Also added a complete DOCUMENTATION of all functions with descriptions of all parameters to help you using my code (see "readme.txt").

Test it and *please* vote for this really useful and good piece of code!

NOTE: Version 3.0 is released, go to http://www.planet-source-code.com/vb/scripts/showcode.asp?txtCodeId=21470


 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
  3. Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 4 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

2/17/2001 5:32:31 PMThe Author

Hi,
I just wanted to explain why the main code is written in C++:
The Code doesn't use SetPixel or GetPixel, but it still uses many loops and calculations, ant it would simply be to slow in VB (BUT: I tried the code in pure-VB and it is still much faster than all comparable codes posted here, less then 100ms for processing a 320x240 picture!!!).
If you want the code of the dll or a VB-Version of the routines, just let me know.
(If this comment was disrespectful, please report it.)

 
2/17/2001 7:35:04 PMKostas D.

Hi Florian. I think i don't have to explain why i voted excellent for you. I'd like nevertheless to ask you a favor and make some suggestions: I have made some filters in VB and are really slow (eg. Blur,Noise,Contrast etc... ). I want to make them in VC++ and assembly. I know programming these for the last 3 years-not much because i am a Database programmer in VB mainly. I think your rotate and alpha filters are extremely greatfull but brightness may need some work (I don't know exactly, this is just a suggestion). But, as you said, if you don't mind could you upload or send me an email of how you make in C++ these best rotation filter and alphablend? And a last big favor and sorry for the large comment. (But ok, you are the best in grafix in PSC). May, if you have time of course, you show me in C++ how to make a quick DLL mosaic filter? Because VB grafix are so slow even with API.
(If this comment was disrespectful, please report it.)

 
2/17/2001 9:17:09 PMThe Author

Ho, thanks for the praises!
First of all, all suggestions are welcome. If you have any effects/filters (like a good brightness control, contrast, blur etc.) feel free to send me the code, and i will update the dll.
my email address is webmaster@flomix.de.
(If this comment was disrespectful, please report it.)

 
2/18/2001 5:13:34 AMNight Wolf

Yo, great code. I really like the anti-aliasing thingy. Here's a site where you can find some great gfx stuff done in vb like HUE, blur and much more.
www.vbaccelerator.com - look in vbMedia.
(If this comment was disrespectful, please report it.)

 
2/18/2001 5:14:54 AMNight Wolf

Oh yeah can you email me the code in vb. Thanks.
(If this comment was disrespectful, please report it.)

 
2/18/2001 5:50:17 AMStephan Kirchmaier

Pls. email me the code in VB too.
(If this comment was disrespectful, please report it.)

 
2/18/2001 6:28:48 AMgain@westerncanada.com

I too would appreciate this in VB code. Excellent work !!
(If this comment was disrespectful, please report it.)

 
2/18/2001 9:23:28 AMfarouk

Excellent work..keep it up
if you could send me the code in vb
and c++ I would be grateful
(If this comment was disrespectful, please report it.)

 
2/18/2001 10:39:46 AMKostas D.

Hi again. Thanks again for your offer to construct my VB filters in C++ but finally i manage to compile myself a non-MFC Win32 DLL using SetP, GetP and LineTo (i had made DLLs for DB Apps previously) which works fast and fine. I also found some good mosaic codes in PSC and Vbaccelerator.com (Thankz to Night Wolf too). I will upload my work with full source code soon. Continue your great coding...
(If this comment was disrespectful, please report it.)

 
2/18/2001 12:11:02 PMEric

Florian,

Great work, and I appreciate your willingness to share it. Can you please send me the code in C++ and VB. Thanks!
(If this comment was disrespectful, please report it.)

 
2/18/2001 12:20:43 PMFlorian Egel

Hey, big thanks to all for the good feedback! Due to the requests i updated the Code: it now contains some new functions (better AlphaBlending, Blur filter, BumpMapping), and a VB-Only-version of the routines. I hope this helps.
(If this comment was disrespectful, please report it.)

 
2/18/2001 3:14:00 PMRay Hildenbrand

Hello, great post. i did notice one thing you might be able to help me with, the alpha blend function ( as well as the bump) just show a black box in this version, but the original posting worked correctly on my system. any ideas? BTW my layer manager control i am developing would really go hand in hand with this code. five globes eh
(If this comment was disrespectful, please report it.)

 
2/18/2001 3:15:53 PMRay Hildenbrand

here is the link if you are interested.

http://www.planetsourcecode.com/xq/ASP/txtCodeId.15182/lngWId.1/qx/vb /scripts/ShowCode.htm

(If this comment was disrespectful, please report it.)

 
2/19/2001 7:33:37 AMFlorian Egel

It was my mistake, I solved the black box problem whith AlphaBlending and BumpMapping (the previous code just worked with 32 bit color depth, now it also supports 16 bit).
(If this comment was disrespectful, please report it.)

 
2/19/2001 8:21:37 AMJeffrey A. Miller

Hello,

Very nice code, extremly fast. Could you please forward me the DLL code in C++ & VB.

Thanks
(If this comment was disrespectful, please report it.)

 
2/19/2001 6:41:06 PMHawk78

Hi Florian Egel !
I've got some questions about your code. Could you please write your e-mail adress for contact!?

Thanks

(If this comment was disrespectful, please report it.)

 
2/19/2001 7:55:46 PMFlorian Egel

sure, my email address is
webmaster@flomix.de.
Ask whatever you want, i would like to help whereever i can. And if you have remarks or suggestions feel free to let me know, too!
(If this comment was disrespectful, please report it.)

 
2/19/2001 8:29:49 PMFlorian Egel

I just added a pretty cool Demo and a complete Documentation of all functions with descriptions of all parameters to the package, check it out if you like!
(If this comment was disrespectful, please report it.)

 
2/22/2001 8:25:52 AMJ. Owen

Wow, this code is AWESOME! I often tried to make such effects, but i never got fast results and all other samples about this are terribly slow, too, but your great code runs real-time even on my comp... Congratulations and thanks a Lot!
5 Globes, you are really worth it.
(If this comment was disrespectful, please report it.)

 
2/26/2001 9:06:18 AMGuido van Laar

Thanks for sharing your great code, I rated you 5 globes.
If possible, I would like to receive a copy of the C++ dll source code (GvL@Pobox.com).

(If this comment was disrespectful, please report it.)

 
2/27/2001 11:49:47 PMdima

Excellent! Really 'MustHave'. Simplest VB coding in aggregate with fastest C or ASM libraries makes a splendid apps. Keep a good work, Florian! My vote is 'Excellent'.
(If this comment was disrespectful, please report it.)

 
3/3/2001 7:16:03 AMFlorian Egel

PLEASE NOTE: Advanced Graphics Routines 3.0 is released. look at
http://www.planet-source-code.com/xq/ASP/txtCodeId.21470/lngWId.1/qx/vb/scripts/Sh owCode.htm


Florian

(If this comment was disrespectful, please report it.)

 
3/14/2001 10:28:27 AMFadi

Man, everyone gets excited to see samples. There is no code for the actual work! its in a DLL! and it won a contest? god people, keep the planet clean!

Sorry for this, but I just think to win a contest, you should post code not samples around a component and release the sample only. I gave it poor rating till code is posted
(If this comment was disrespectful, please report it.)

 
3/14/2001 7:43:12 PMFlorian Egel

If you would have looked at the code, you would have seen that there is a VB-only-version with full source... sorry, but your statement is just wrong.
(If this comment was disrespectful, please report it.)

 
3/14/2001 11:07:20 PMfadi

My mistake, I missed the VB version only
(If this comment was disrespectful, please report it.)

 
3/15/2001 11:35:34 PMRoger the Camel

Hey Florian Egel, from what I have read in all this feedback ur the man to see about graphic effects... well Im currently in the process of making a game, 2D RPG, kinda like zelda on snes but with better looking graphics. Well anyway, i want to put some graphic effects in that will add to the atmosphere of the game and i was wondering if ud like to work with me, even if its as an advisory role or something, anyway, my e-mail is grant73@ihug.co.nz, contact me if you would like.
(If this comment was disrespectful, please report it.)

 
6/1/2001 9:40:22 AMGiacomo

Hi Florian, I'm only sorry that my limited knowledge of English is not enough to express my appreciation (and I had only saw version 2.2...non I'm going to look for version 3.2).

If I do not bother you, I would have a question (hope not too silly): which is the difference (in coding) between Brightness and Saturation control ? I wanted to implement them (in VB6) , but in my mind the approach seems the same.
Thanks anyway
Giacomo

(If this comment was disrespectful, please report it.)

 
6/19/2001 1:41:03 AMPritesh Sheth

Hi there,
This is Pritesh Sheth from India,
First of all, your code is GREAT!!.
I am a programmer, developing small application, and would like to use you .dll, can i use it ? and it will be so nice of you if u could send me the c++ code so that i can learn how things are done.

hey, one thing it crashes or leacking memory while dealing with big size bitmaps (1024*768) specially alphablend.

(If this comment was disrespectful, please report it.)

 
6/19/2001 10:00:32 AMFlorian Egel

I got many mails complaining that the dll does not work properly with big pictures like 1024x768, but it was not designed to. I focused on realtime-speed with smaller pictures, not on compatibility with large pictures. If I would not be so busy, I would perhaps write another DLL to do these tasks... ;-)

Florian Egel
(If this comment was disrespectful, please report it.)

 
8/7/2001 12:38:31 PMKevin

ooooo can i have the dll too?

(If this comment was disrespectful, please report it.)

 
10/15/2001 5:21:21 PMFlorian Egel

MESSAGE TO ALL:

I know, I ignored your requests for the source code for the last months and I am very sorry about it, but I was really busy and got almost no time to go online.
I apologize to all of you and uploaded the sources to my homepage. You can find them under

http://www.flomix.de/download/foxcbmp_src.zip

Regards, Florian Egel
(If this comment was disrespectful, please report it.)

 
5/11/2002 6:08:06 PMMunky

hey, i would love for you to send me the source for the dll file. i hate that vb cant do rendering that fast
(If this comment was disrespectful, please report it.)

 
9/18/2002 9:35:05 AM

A little speed-up for the main sum in the alphablending routine that may be worthy of discussion from the DLL source, FoxCBmp.cpp ShadeColors(...):

default : return ((((Src&0x0000FF)*(~Shade))>>8)+(((Dst&0x0000FF)*Shade)>>8))&0x0000FF
|((((Src&0x00FF00)*(~Shade))>>8)+(((Dst&0x00FF00)*Shade)>>8))&0x00FF00
|((((Src&0xFF0000)*(~Shade))>>8)+(((Dst&0xFF0000)*Shade)>>8))&0xFF0000;

(If this comment was disrespectful, please report it.)

 
9/27/2002 9:29:48 AM

VERY VERY VERY GOOD.
(If this comment was disrespectful, please report it.)

 
11/8/2002 11:35:27 AM

Excellent work.
if you
could send me the code in vb
and c++ I
would be grateful
I have 2 version of the DLL but not completed
thanks
jean borgugnons
jean.borgugnons@skynet.be
(Belgium)
(If this comment was disrespectful, please report it.)

 
10/8/2003 3:20:18 AM

How come the .dll wasn't in the download?
Can anyone tell me where to get it?
(If this comment was disrespectful, please report it.)

 
12/3/2004 8:54:19 AM

Absolutely fantastic! This is the fastest graphic rendering i've seen in VB and i've seen them all! Especially for Picture rotation.
One question though: How to move the PicRot graphic (ie the graphic above the background after Rotate) programatically?
Got the answer? Please let me know via email@a-m-b.co.uk. Thanks! :0)
(If this comment was disrespectful, please report it.)

 
2/25/2007 7:21:34 PMTimo Böhme

Just searching for any Gauss Blur effect for a picture. Can you email me some code?
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.