|
-
Nov 10th, 2001, 05:06 AM
#1
Thread Starter
Fanatic Member
Some Bitmap -> Get More/Less Light
Hi,
I have a question.
I have some BMP file...
I want within my game, change its light, darker or lighter, whatever I choose.
How can I do it?
Thank you,
Arie.
-
Nov 10th, 2001, 06:37 AM
#2
Lively Member
Need tha too!
They don´t answer.
But it´s not a bitmap, just a part of the screen, where i want to change the gamma!
-
Nov 10th, 2001, 03:17 PM
#3
Thread Starter
Fanatic Member
I have done it.. but...
See, I don't think my way is fast for big pictures.
here is the change that I do:
L = 1 is the same light as original
Code:
Private Sub Command1_Click()
Dim I As Integer, J As Integer
Dim mR As Integer, mG As Integer, mB As Integer
Dim L As Single
L = InputBox("Enter the Light power(0.1-1.9):", "Light Power")
If L < 0.1 Or L > 1.9 Then
MsgBox ("Light is not in range!" & vbCrLf & "Setting to 0.5")
L = 0.5
End If
TempDC = LoadDC("F:\Real\1.jpg", Form1.hdc)
BitBlt Form1.hdc, 0, 0, 16, 16, TempDC, 0, 0, vbSrcCopy
For I = 0 To 16
For J = 0 To 16
mR = (GetPixel(TempDC, J, I) And 255) * L
mG = (GetPixel(TempDC, J, I) \ 256 And 255) * L
mB = (GetPixel(TempDC, J, I) \ 65536 And 255) * L
SetPixel TempDC, J, I, RGB(mR, mG, mB)
Next J
Next I
BitBlt Form1.hdc, 16, 0, 16, 16, TempDC, 0, 0, vbSrcCopy
End Sub
I wonder if there is a faster way to do it?
Thank you,
Arie.
-
Nov 10th, 2001, 04:11 PM
#4
-
Nov 10th, 2001, 06:05 PM
#5
Good Ol' Platypus
You'll be happy if you go see the "Suggestions for Rewrite of Graphics Library" thread by Janus. It has GDI operations that are up to 300 FPS fullscreen on a 1 GHZ machine! (well, at least the old one did )
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Nov 11th, 2001, 11:19 AM
#6
Thread Starter
Fanatic Member
Do you have the Link to it?
Maybe Code?
Thank you,
Arie.
-
Nov 11th, 2001, 03:12 PM
#7
Lively Member
Well, thanks, i downloaded it and read your last posting.
I have the same problems with running the included demo game....
How does that work?
There IS no f2Init...
-
Nov 12th, 2001, 03:50 PM
#8
Thread Starter
Fanatic Member
Please tell me exactly the address for this post you told about.
Thank you,
Arie.
-
Nov 13th, 2001, 09:43 AM
#9
Lively Member
Search for: "Suggestions for Rewrite of Graphics Library"
on this board
-
Nov 15th, 2001, 01:07 PM
#10
Hyperactive Member
It ain't there!
I went there but didn't get the download. Just a recusive link to the thread. What gives? Can someone post it?
-
Nov 15th, 2001, 01:14 PM
#11
Lively Member
You´re somewhat slow, eh? (don´t take it serious)
If you search for: "Suggestions for Rewrite of Graphics Library" it will turn up the thread: "I need suggestions for my rewrite of my graphics library."
If you click on that, you see the link: "Download the Fury2 Graphics Engine"
If you click on the link there, you´ll get to a post, which includes the file.
Or HERE it is too: http://www.vbforums.com/attachment.php?s=&postid=563943
-
Nov 16th, 2001, 12:41 PM
#12
Hyperactive Member
No offence taken. I am retarded by technology's simplicity!
-
Nov 16th, 2001, 05:10 PM
#13
Hyperactive Member
Uhmm... I tried to refrence the .dll through vb "add refrence" and got an error "Can not refrence <filename>". How do I get at and use this through VB?
-
Nov 17th, 2001, 04:00 AM
#14
Lively Member
dunno, on my pc it doesn´t work...
-
Nov 17th, 2001, 06:22 AM
#15
Lively Member
There are 2 dlls. only reference to the second one...
-
Nov 18th, 2001, 02:46 AM
#16
Thread Starter
Fanatic Member
DOES ANYONE CAN POST A SIMPLE CODE?
Guys, guys...
I need a simple code that it will be used for getting more/less light in a picture... I need a fast function...
Thank you,
Arie.
-
Nov 18th, 2001, 09:52 AM
#17
Good Ol' Platypus
Yes, that's a common problem with VB! That's why DirectDraw was invented, you know. It can do this fast as well, although it doesn't work with the traditional GDI interface (DCs).
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Nov 18th, 2001, 09:54 AM
#18
Lively Member
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
|