Transparency, BitBit() And Number Sorting
1. Transparency Will a gif with a transparent background still have a transparent background on a form? If not then how can i get transparent backgrounds?
2. BitBit() Unless it is very complicated and hard to explain could you show how to use BitBit() for animation?
3. number sorting i have this code:
VB Code: Dim dblAns As String Dim intDig As IntegerDim dbl As StringdblAns = "2856457889" For intNum = 1 To Len(dblAns) intDig = Mid(dblAns, intNum, 1) If (intDig Mod 2) = 0 Then If Len(dbl) Then dbl = dbl & ", " & Format(intDig) Else dbl = Format(intDig) End If Else dbl = dbl & Format(intDig) End IfNext intNum MsgBox "The numbers are:" & dbl
it splits the number 2856457889 into 2, 85, 6, 457, 8, 89 even numbers start a new number rather than putting the split numbers into a string and displaying it in a msgbox i want it to load a new txtbox eg. txtNum fo each number.
thnx 4 help and i hope this post is more successful than last time
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Number Sorting
a, b, c, d, e, f, and g are all numbers. What i want to do is execute one statement if a is the biggest number, a different statement if b is the biggest number etc. How do i do this?
Thanks!
Sorting A Listbox By Number
Hi,
I've got a listbox that displays scores and the user's name next to it. I want to sort this listbox with the lowest number coming first... (regardless of what the person's name is - in other words... a highscore table)
I've found the list1.sorted command but that doesn't seem to work with numbers.
and I've tried a bubble sort using the following code but again... is not sorting the numbers in to order:
Code:
Private Sub SortListBox()
Dim intCount As Integer
Dim strSwap As String
Dim boolDidSwap As Boolean
Dim intI As Integer
intCount = LstHighScores.ListCount - 1
Do
boolDidSwap = False
intCount = intCount - 1
For intI = 0 To intCount
If LstHighScores.List(intI) > LstHighScores.List(intI + 1) Then
strSwap = LstHighScores.List(intI)
LstHighScores.List(intI) = LstHighScores.List(intI + 1)
LstHighScores.List(intI + 1) = strSwap
boolDidSwap = True
End If
Next intI
Loop While boolDidSwap
End Sub
Any help here would be grately appreciated.. thanks
/Mark
Edited by - kram044 on 3/3/2004 6:03:57 AM
Help With BitBit
Hello,
I am new to the gaming scene. I have picked up a little here and though however. I was wonder how to determine the size of the map window? Uhh...How to make it Show more of the map? The example I am looking at only has a small block, but I want to increase it to view more map at a time. Any suggestions on where to start?
Bitbit Help
hey i am making a character moving using bitblt to bit the character into a picture box
how to i make it so when i move the picture it will not leave the previous picture behind. so it will look like that character is moving.
thanks
BitBit Help
first off, what is Bit Bit, and how do you use it, can someone give me a good place to learn it from, tutorials or something, thanks in advance
Sorting Fields (number) Problem
Hey all,
I have a slight problem. I have some records in a table with a field that stores numbers. Some of the records do not have an entry in that field and I have left them blank. However, when I run a query and sort the number column ascendingly, the records with the blank value are above the ones with actual values in them. I want the records with number values to be before the records with the blank values and in ascending order.
The problem for me is that it is part of a query and I would prefer it if I didn't have to write some code to do it, I am trying to keep my UI as simple as possible.
Holding Number And Strings, Then Sorting
Is there a way to load the contents of a text file of format:
"name","score" - .e.g. "jon","6"
and then display them in a listbox, sorted by the score (highest first) and preferably given a rank. e.g. 1. Amy - 20
Thanks (sorry for the short post - I am working to a strict timescale and am trying to complete as fast as possible)
Sorting Listview W/ Text && Number?
Ok, I can easily sort my listview by the columnindex if it is text. However, some of my columns contain numbers. I had a module from Planetsourcecode that did this, but there was one major flaw. Everything sorted fine, but after it was sorted the items would be mixed up. Here's an example of what I mean:
Say we start out sorted lvwascending. "Bob" is the second item in the listview. Now we sort by lvwdescending. Now "York" is the second item right? but when you execute something on York you get the information on "Bob". Any help with sorting without things getting mixed up is extremely appreciated.
-Jeremy
Sorting Text Field As Number
Hi, i am facing a problem which is i have to sort a text datatype in to numeric order when selecting data, e.g:
orginal:
1.01
1.02
10.01
10.02
2.01
2.02
Want to be:
1.01
1.02
2.01
2.02
10.01
10.02
Please help with urgent!!!! thanks a lot
Working With BitBit
Hi,
I've just began using BitBit now, so i'm not too good, i'm progressing slightly, but have a small problem...
Anyway, i've began making a square grid based maze game to get used to the functions of BitBit and cant seem to get something right, the game currently in no way resembles a maze, because I haven't started that bit yet...
To move the sprite properly, on a square-based grid i have set up an intXNow value to work with the intX, so that the character only moves so far at a time, by presetting intX to 10, then everytime you press to move, intXNow updates itself to equal intX, then runs the movement part on a timer...
Code:
Do Until intX >= intXNow + 50
-- movement code --
Loop
This works fine, but when you run it the first time he moves, he does four steps, the next time he does 5 steps, so he is no longer in the center of the x-axis grid...
I'm not sure what I have done wrong with this code.
Can somebody please look at my source code and tell me what i have done wrong to cause this uneven movement.
The source is in the zip below...
Your Help Is Greatly Appreciated.
Just Cant Understand BitBit!
Ok, ive tryed to understand this stuff for about 4 hours by now. And i just dont GET IT! I get NO ERRORS at all, but NOTHING HAPPENS either. So i wondered if anyone would post a newbie BitBit program for me.
thx
BitBit Error
When i try to initialize BitBit i get this error:
Help????
BitBit With MSChart
Can you use BitBit to make a realtime MSChart Graph not flicker? I've looked through some of the threads here and they seem to mainly use pictureboxes for gaming. Is the principle the same, if so how would i implemet it?
Thanks
Sean
Sorting Serial Number In Data Reports
I am using Data Reports via Data Environment.,
I wrote this query to print SERIAL NUMBER on the data reports...
Please note that I am not using any temporary table to extract any bogus serial number entry... this code representing serial number via SQL Query....
now the problem is this that the serial number column is a virtual column created by SQL query which is associated with the ID(which is unique) which must be sorted in ascending order with this ID .... but it is in descending order.....
Anyone can solve it....??????
DLLImport - GDI32.dll - BitBit -
hi,
the Issue is ,
I would like to crop part of image. (I know the rectangle to be cropped from the tiff image). I tried DrawImage. But some Pixel Information is lost.
So I am trying to use BitBit approach.
My Code is ::::::
---------------Declaration - ----------------------
<DllImport("gdi32.dll", EntryPoint:="BitBlt", SetLastError:=True, _
CharSet:=CharSet.Unicode, ExactSpelling:=True, _
CallingConvention:=CallingConvention.StdCall)> _
Public Shared Function BitBlt( _
ByVal hdcDest As IntPtr, _
ByVal nXDest As Integer, _
ByVal nYDest As Integer, _
ByVal nWidth As Integer, _
ByVal nHeight As Integer, _
ByVal hdcSrc As IntPtr, _
ByVal nXSrc As Integer, _
ByVal nYSrc As Integer, _
ByVal dwRop As Int32)
End Function
Private Const SRCCOPY = &HCC0020 ' (DWORD) dest = source
-----------------------
My function for cropping is
----------------------------
Dim g1 As Graphics = PictureBox1.CreateGraphics()
Dim imgCrop As New Bitmap(200, 200)
Dim g2 As Graphics = Graphics.FromImage(imgCrop)
Dim dc1 As IntPtr = g1.GetHdc()
Dim dc2 As IntPtr = g2.GetHdc()
BitBlt(dc2, 0, 0, 200, 200, dc1, 100, 200, SRCCOPY)
g1.ReleaseHdc(dc1)
g2.ReleaseHdc(dc2)
imgCrop.Save("c:Captured.jpg", ImageFormat.Jpeg)
MsgBox("Finished Saving Image")
------------
Error Msg :::
Unhandled Exception
PInvoke restriction: cannot return variants.
Anyone has idea about where I am doing wrong. Or any better approach for this
Make Bitmap Transparent With BitBit
Hi all -
Lets say I have a bitmap with a region that has been marked with a certain color to detone a transparent area - how could I go about BitBit'ing on top of another picture in VB so that the solid color becomes transparent? THanks
-Chris
Hmmm....bitbit Seems Easier Than Trying To Do Maps With An Editor?
Hello again,
I got my map working with bitbit, but the things are super small. I can barely see em hehe, anyone got a site that will show the break down of bitbit that what represents what? I had to just play with some and just do a row of numbers and see what I came out with. The last question is, to increase the actual size my bits display at do I need to increase the pixel size?
Thx for any help.
Questions: BitBit Moving, Walkmasks And Item Pickups.
Ok, so far have i quickly created a small program where a picture(the guy you control) moves instantly to the location of your click. Theres 3 things i must now:
1. How can i make my guy move slowly to the targeted location? not instantly.
2.How can i create walkmasks? Forexample if i create a tree, and i dont want my guy to walk right through the tree but around it.
3.How can i make my character pick up items? Forexample how can i make my guy get 10 score-points when he moves over an item, which in reality is a picture.
Edit*
I use BitBit.
This is not going to be a real game, iam just testing things out before i start creating a game.
Nothing is animated.
Sorting Large Number Of Large Text Files
Hi,
I have around 500 text files (csv format). Each file is ca. 5MB and sorted by a timestamp. my application needs to playback all these files line by line but sorted by time.my goal is not to put all files in memory, use a sorting algorithm, create one sorted output file and then read from the output file.
I am rather thinking of sorting the files as they stream. For this I would only need to know in each file the time stamps of the current lines and compare them to each other.
what is the best way to do this? any ideas?
thanks
ListBox Sorting Numerically / Array Sorting
I've made a game and as a finishing touch I want to add a network scoreboard. I can simply do this by writing to a textfile on the network using:
VB Code:
Open App.Path & "Scores able.txt" For Append As #3Write #3, frmMain.lblName, frmMain.lblSClose #3
and it writes "Fred","6" with 6 being the score.
This works great but I now want to have a leaderboard on start-up and a listbox displaying all scores. I can do open for input and then plonk the contents of the textbox in the listbox, but I can't make it sort numerically, so the highest score is at the top. Alphabetical sorting doesn't work unsuprisingly! Is there an easy way to do this? This is what I currently have:
VB Code:
Open App.Path & "Scores able.txt" For Input As #1Do While Not EOF(1)Dim strIn As StringDim strInS As StringInput #1, strIn, strInSlstLeaders.AddItem (strInS & " - " & strIn)LoopClose #1
Perhaps I could put them into an array and then is there a way of sorting this?
I also want a Top-Ten leadboard, but I assume this would be easy to make once the valuse are sorted. It would also be a nice touch to tell the player their rank after the game too.
Any ideas?
Thanks!
Bubble Sorting And Txt File Sorting Help
ok i did a seach and found nothing i mean nothing so im really sorry if i upset anyone with my question.
Ok here is what i have but ive been asked to take the text file and sort if it isnt organized. and to be honest i have no idea can someone plz exaplain to me the general idea? i was thinking about using Case select for it, all i need is help on sorting the text file and any advise would be very helpfull. this is also for school
PHP Code:
Private Sub cmdCreateReport_Click()
Dim currentMonth As String, newMonth As String
Dim dayNum As Integer, address As String
Dim price As Single, monthTotal As Single
Dim yearTotal As Single, doneFlag As Boolean
'Display home sales by month
picReport.Cls
Open App.Path & "HOMESALE.TXT" For Input As #1
currentMonth = "" 'Name of month being subtotaled
monthTotal = 0
yearTotal = 0
doneFlag = False 'Flag to indicate end of list
Do While Not doneFlag
If Not EOF(1) Then
Input #1, newMonth, dayNum, address, price
Else
doneFlag = True 'End of list
End If
If (newMonth <> currentMonth) Or (doneFlag) Then 'Control break processing
If currentMonth <> "" Then 'Don't print subtotal before 1st month
picReport.Print
picReport.Print Tab(15); "Subtotal for "; currentMonth; ":";
picReport.Print Tab(38); FormatCurrency(monthTotal)
picReport.Print
End If
currentMonth = newMonth
monthTotal = 0
End If
If Not doneFlag Then
picReport.Print newMonth;
picReport.Print Tab(11); FormatNumber(dayNum, 0);
picReport.Print Tab(18); address;
picReport.Print Tab(38); FormatCurrency(price)
yearTotal = yearTotal + price
End If
monthTotal = monthTotal + price
Loop
Close #1
picReport.Print "Total for First Quarter: "; FormatCurrency(yearTotal)
End Sub
Quote: Text File
"January", 9, "102 Elm Street", 203000
"February", 23, "2 Vista Drive", 145320
"January", 20, "1 Main Street", 315200
"February", 15, "1 Center Street", 100000
"March", 15, "205 Rodeo Circle", 389100
"January", 25, "5 Maple Street", 123450
Transparency In WMF And GIF
I'm trying to save a WMF as a GIF using GDI+ but
bitmap.loadfromfile wmffile
bitmap savetofile giffile, gifcodec,0
loses the transparency.
Should the transparency be preserved automatically?
Do I have to find the transparent color in the wmf so I can set it in the gif? If so, how do I do that?
Transparency
I am making a special deck of cards. I need to paste the image of a card on top of an image. I could do this in paint, but it would take about 5 hours.
Transparency
Howdy Doo
Ok How do i get it so when a user selects an image on 'Form1'
Example 1:http://dale.host.sk/1.gif
Then once they select that image, they click a button to goto the next form 'Form2' then they select another image
Example 2:http://dale.host.sk/2.gif
Then once thats selected it goes to 'Form3' which shows the result (Form1 & Form2 image have been merged together (transparency)) and then it allows the user to save that image.
Example 3:http://dale.host.sk/3.gif
...
Transparency
ive used someones code to make a form transparent
when it fires up.
I also have a gif with rounded edges because i made the
edges pink and made them transparent in a GIF editing
program i have.
I added it into a Image Control thinking yeh its edges are
transparent now my form will look like it has rounded edges
but..............i was wrong it took me awhile to figure out
but it seems the IMAGE CONTROLS corners on the transparent
parts of the GIF image are visible which makes it look crappy
does anybody know another way i could go about this?
Transparency
This is what I need to do:
Make a form with a transparent background (you can see the desktop and windows behind the form)
Keep all of the controls Opaque
Allow a transparent Gif in an Image control to become transparent as well
Does anybody know how to do any of these? The first 2 are easy... 3rd keeps bugging me
Transparency Help
Ok, so what i am doing is making a map program - i want to add circles to positions on a map. the program works by drawing these circles on the picturebox using .circle, but now i ran into a problem. how can i move these circles once they have been drawn? i have thought of maybe having a transparent picturebox placed on top of the actual picturebox that holds the map, then draw the circles on that. (if i wanted to reposition one circle, i could easily delete its pixels and still have the map benith). but i do not know how to make a transparent picturebox that does this. i also thought of bitblt, but when i try to save the image what is blitted is not part of the image. so it seems that a transprent picturebox may work better (then for saving just merge the two pictureboxes). any help is appreciated!
Transparency
I want to transparent a texture that use Alpha channel I know how to alpha blend a texture by set these two render state
Code:
Direct3DDevice.SetRenderState D3DRS_SRCBLEND, D3DBLEND_SRCALPHA
Direct3DDevice.SetRenderState D3DRS_DESTBLEND,D3DBLEND_INVSRCALPHA
But How can I make it transparent?
Transparency
Does someone know how to make something transparant in windowed mode with DirectDraw??
Transparency
Hey, I'm trying to make an Isometric RPG using BitBlt, and I was wondering is it possible to create the see-through wall effect with BitBlt?
Thanks.
Some What Transparency DX7
Im working on a game. It uses dx 7 and directdraw, how can i make it blt the image somewhat transparent.
Transparency
I want to make something like a Ping Pong. I need a ball. I have a .bmp file with it. I also have a background. It's not solid. That's why i need ball to have transparent corners. How to do it?
Thanks in advance
Transparency
I'm trying to use Forms 2.0 Image, but I need transparency. There is a property Backstyle, I set it to transprant, it looks ok inn design, but when running, it shows transparent, them immediately goes opaque again.
Transparency
I found some code at PSC that showed how to make your forms transparent. However it only worked in Windows 2000 and Windows XP. The only form transparency code i found for other Win OS was taking a screenshot of the background then blending the background with the form. Does anyone know if there is another way to accomplish transparency for Win9x/ME/NT4.0?
Transparency
Is it possible to have a txtbox's white background to a transparent background?
Or is it possible to have a picture background instead of color for txtbox??
One day I will be the one who posts the answers,today I only have questions...
Transparency
Wow. Long time since I have posted a question.
Anyway, I need to know how to make the backcolor of a Tabbed Dialog Control transparent.
I have a few ideas, but they are tedious.
Thanks.
-cl
<a href="http://vb.wsoftware.net" target="_new">http://vb.wsoftware.net</a>
Gdi+ And Transparency
Please, help me!!!
I use gdiplus.dll for load images. How I can get a transparent color?
Transparency
Hey,
I have a few images and buttons on my form, but I want everything but those buttons and images to be TOTALLY transparent - nothing else seen. (I already have the title bar gone, so no need for that)
I tried changing Background Color, but there was no "Transparent" under that.
Transparency?!
I know this has been asked many times but how do you bitblt a transparant image without creating a mask for every picture and not using Transparantblt.
I used this example: http://www.codeguru.com/vb_graphics/...nsparency.html
but it has a memory leak...
Transparency
What's the difference between the TransparentBlt and GdiTransparentBlt API functions?
Transparency Key In Vb6
hey i have used vb 2008/.net and in properties i can set the transparenky key cant do this in vb 6.0 though any one got any idea on how i can get it btw if u know any other way i am tring to get a image to be the forum so i would set forum border style to none and then set the image is back grounf and set back grounfd color to black and set img transprency key to bacl exept i cant fin img transparenky key any one know a work around or how to get transparent forms thanks in advance
Transparency
now I have asked this question several times but I can never get satisfactory answers. I will try to explain clearly. I have a picturebox. i has a picture of lets say a bear in it. I have an image control contined within the picturebox. this has a picture of a small fish.the fish's background is blue, but I want it to be invisible, so you can see the bear behind it. I can do this on photoshop, but I want visual basic to do it. How?
Transparency
If I make a PNG file with transparent bits, then open it in an image in visual basic, I can see through the transparent bits, but if I just have an ordinary bitmap, I cant. How can I make a programme that can make certain colours invisible?
Transparency
I'm not sure what the best way pf achieveing the affect I want is but I was thinking of using a transparent form.
My aim is to display a game interface with semi transparent sections over a map.
I want the buttons and the general interface to be semi transparent so the map can be see through it and then the rest of the area fully transparent.
Any help would be apreacited. I was think I could try something along the lines of BitBlt mask when black and white make transparent but I couldn't do it.
Thanks Ben
Rtf Transparency
How can I make a richtext component have a transparent background?
Transparency
I remember some weeks ago, someone posted comments on this fourn about getting picture box into transparency... Eventhough if you run application, there would be picture box at present, but is invisible seeing any kind of carve in shapes on form or so... Would any one know anything about it? I would like to know how if its possible. I have tried search engine, unfortunately there isnt any luck, let me know
ICO And PNG And Transparency
Is there any way I can convert a 32x32 PNG image with transparency to a 32x32 standard windows ico, transferring the PNGs transparency to the ICO?
Please help me, I’ve searched everywhere for an answer.
My app is written in VB6, but I can use VB.NET too by creating a dll is there’s no other way. Quite frankly, I’m open for nearly any solution, gdi or other dlls, no problem.
Kevin
A Little Help With Transparency
Hi,
I am currently working on a program that I wish to create different skins for. I have a couple of questions.
1)How do I make a form transparent in the simplest of ways? I need to introduce it to the current version of my program.
2)How do I access User Controls through code?(eg. change a picture in the control.)
Any help with these questions is appreciated.
Regards, Simulator
|