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.
Printable View
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.
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!
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
I wonder if there is a faster way to do it?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
Thank you,
Arie.
I know, I use a similar one for brightness and contrast. For a game with a huge Bitmap, no chance. Calculating for hours!!! :mad:
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 :))
Do you have the Link to it?
Maybe Code?
Thank you,
Arie.
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...
Please tell me exactly the address for this post you told about.
Thank you,
Arie.
Search for: "Suggestions for Rewrite of Graphics Library"
on this board
I went there but didn't get the download. Just a recusive link to the thread. What gives? Can someone post it?
You´re somewhat slow, eh? :D (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
No offence taken. I am retarded by technology's simplicity!
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?
dunno, on my pc it doesn´t work...
There are 2 dlls. only reference to the second one...
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.
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).
That´s only half true. :D
I use DCs to put Pics in the DD Backbuffer, change the light and contrast and flip it to the primary surface. It DOES work with DCs ;) :D Well, bit slow...