|
-
May 14th, 2001, 07:18 AM
#1
Thread Starter
Addicted Member
DD Image darkening
Hi,
Is it possible to blit an image to screen with DD/BltFast (fullscreen), and also darken it to a certain amount? Is there an easy way to do this?
-Git
-
May 14th, 2001, 07:25 AM
#2
Good Ol' Platypus
Well you could make a black surface (bltcolorfill it) and then alphablend them together w/microsoft's alphablend function.
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
May 14th, 2001, 09:51 AM
#3
Frenzied Member
Nah, I think that function only works in Win98 (not sure). You should use something more reliable, like a custom DLL 
Look for vbDABL, it's the best one in my opinion. You can find it in any search engine I think, if not, reply here and I'll e-mail it to you.
-
May 14th, 2001, 01:31 PM
#4
Fanatic Member
That DLL won't work without MMX, and my own pc doesn't have MMC 
If you really want control and speed, plus some other nice things like rotation, you could also use Direct3D:
Direct3D -> 2D, Rotation
Direct3D -> 2D, Faking Light (the darkening you're looking for)
Direct3D -> 2D, Alpha Blending
Those are samples I've uploaded to PSC when I started using Direct3D for 2D graphics...
Teaudirenopossum.Musasapientumfixaestinaure.
(I can't hear you. There's a banana in my ear)
-
May 14th, 2001, 05:39 PM
#5
-
May 15th, 2001, 02:08 AM
#6
Fanatic Member
I don't know ASM, but I started learning C++ and Delphi recently. Delphi is easier, but I think C++ is a little faster (haven't really tested the Delphi DLL, but the C++ DLL was 900% faster than VB!!!!). AFAIK, ASM is a little faster than C++, but I never even tried to understand it...
Btw, the test I performed was between a C++ DLL, and a VB ActiveX DLL, both doing array manipulation to change pictures (without lookup tables)... there's an example at http://www.vbexplorer.com/directx4vb/ (Code -> General VB Gaming -> C++ DLL), which I used as a base for my code, not too difficult really...
Teaudirenopossum.Musasapientumfixaestinaure.
(I can't hear you. There's a banana in my ear)
-
May 16th, 2001, 03:14 AM
#7
Frenzied Member
Hey PsychoMark, thanks for the link! I've been looking for that for AGES!!! And it's easier than I thought 
Also, why did that DLL work only with MMX, and is it THAT fast?
-
May 16th, 2001, 03:50 AM
#8
Fanatic Member
It uses MMX because of some 64-bit buffers or something. I don't know much about it, but it's explained at the DirectX4VB site...
Don't know how fast it is; my P133 doesn't have MMX, so even though I have a P550 which does support it, I forgot about it ASAP (didn't want to force the user to have MMX)...
Teaudirenopossum.Musasapientumfixaestinaure.
(I can't hear you. There's a banana in my ear)
-
May 16th, 2001, 03:53 AM
#9
Thread Starter
Addicted Member
Hmm...is there any way to do it with Direct X/Draw 7? I'd prefer not to use DX8 or D3D (my entire program is written in DD7), but I guess I might not have a choice.
-Git
-
May 16th, 2001, 04:31 AM
#10
Fanatic Member
For your problem, there are generally 3 ways:
- create some slow VB code
- create a C++ DLL which handles it
- use Direct3D
Teaudirenopossum.Musasapientumfixaestinaure.
(I can't hear you. There's a banana in my ear)
-
May 18th, 2001, 10:09 AM
#11
-
May 18th, 2001, 10:15 AM
#12
Fanatic Member
You can amazing things with the DirectDraw GetLockedArray function and a C++ DLL, that's for sure.... I almost can't wait to see your DLL Jotaf98 
Also, if you make the DLL accept an array, you can use it for both the DD GetLockedArray call and you can apply it to normal PictureBoxes (I've got a sample program here which get's an array from a picture for fast manipulation, somewhat like the GetLockedArray thing, which is pretty fast, a lot faster then Get/SetPixel anyways). Now wouldn't that be nice
Teaudirenopossum.Musasapientumfixaestinaure.
(I can't hear you. There's a banana in my ear)
-
May 20th, 2001, 09:38 AM
#13
Frenzied Member
The DLL is coming a long good, I've done it in VB and it works very well, so all I need to do now is translate it into C++.
The DLL will manipulate ARRAYS, not surfaces! You can use it with anything you want, as long as it's 24-bits, NO MATTER IF IT'S RGB OR BGR. Also, the lookup tables will be built-in, so all you have to do is write a simple blting function that handles cut edges (I'll provide one, so don't worry)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|