Quantcast
Channel: VBForums - Games and Graphics Programming
Viewing all 263 articles
Browse latest View live

[Help] creating a bot

0
0
Hey there,

I want to create a bot that can play a 2d games (something like Mario). I just don’t know where to start. I try searching Google and couldn’t find what I was looking for because I don’t where to start. I know c++ and vb.net well.

Here all this thing that I want the bot to do:
•Start program and lock on it.
•find the main char on screen and draw box around him
•find monster(s) on screen and draw box around them
•I want char to move to monster and perform an action.

I’m doing this to increases my knowledge of programing and kick my brother in this game. You see I have full time job and it`s hard for me to play this game after come from work. I want make this bot and run it while I am at work. So, If someone can tell me where to start that will great?

Thank you :)

[RESOLVED] [VB6] - transparent opacy by pixel

0
0
i build 1 sub for do the transparent opacy.
and i belive that i have some errors on it, because i have bad results:(
Code:

'Opacy an image(alpha blend): finalrgb = a*rgb1 + (1-a)rgb2
Public Sub TransparentAlphaBlend(ByRef SrcHDC As Long, ByRef DstHDC As Long, ByRef SrcWidth As Long, SrcHeight, ByRef Opacy As Integer, ByRef TransparentColor As Long)
    Dim x As Long, y As Long
    Dim lngsrcColor As Long
    Dim lngdstColor As Long
    Dim lngNewColor As Long
    Dim dblAlphaDst As Long
    Dim dblAlpha As Double, R As Long, G As Long, B As Long
    Dim SrcRed As Long, SrcBlue As Long, SrcGreen As Long
    Dim DstRed As Long, DstBlue As Long, DstGreen As Long
   
    'convert between 0-100 to 255
    dblAlpha = Opacy * 255 / 100
    dblAlphaDst = dblAlpha - 1
    For x = 0 To SrcWidth - 1
        For y = 0 To SrcHeight - 1
            lngdstColor = GetPixel(DstHDC, x, y)
            lngsrcColor = GetPixel(SrcHDC, x, y)
            If lngsrcColor <> TransparentColor Then
                DstRed = lngdstColor And 255
                DstGreen = (lngdstColor And 65535) \ 256
                DstBlue = (lngdstColor And &HFF0000) \ 65536
                SrcRed = lngsrcColor And 255
                SrcGreen = (lngsrcColor And 65535) \ 256
                SrcBlue = (lngsrcColor And &HFF0000) \ 65536
             
                R = (dblAlpha * SrcRed) + dblAlphaDst * DstRed
                G = (dblAlpha * SrcGreen) + dblAlphaDst * DstGreen
                B = (dblAlpha * SrcBlue) + dblAlphaDst * DstBlue
                lngNewColor = RGB(R, G, B)
                SetPixelV DstHDC, x, y, lngNewColor
            End If
        Next y
    Next x
End Sub

maybe is my converstion or how i combine the colors i don't have sure. can anyone tell me how combine the colors for opacy, then maybe i can fix the sub. the R,G or B are more than 255 and i know that isn't a correct result(i recive overflow error on RGB function):(
can anyone advice me?

[VB6- DIB's] - transparent opacy by pixel

0
0
i rebuild my code for do the opacy.
but i don't understand why takes so many time and the results aren't what i expected:(
Code:

Option Explicit

Private Type BITMAPINFOHEADER
  biSize As Long
  biWidth As Long
  biHeight As Long
  biPlanes As Integer
  biBitCount As Integer
  biCompression As Long
  biSizeImage As Long
  biXPelsPerMeter As Double
  biClrUsed As Double
End Type

Private Type BITMAPINFO
  bmiHeader As BITMAPINFOHEADER
  bmiColors As Long
End Type

Private Declare Function StretchDIBits Lib "gdi32" (ByVal hdc As Long, _
  ByVal x As Long, ByVal y As Long, ByVal dWidth As Long, ByVal dHeight _
  As Long, ByVal SrcX As Long, ByVal SrcY As Long, ByVal SrcWidth As _
  Long, ByVal SrcHeight As Long, lpBits As Any, lpBI As BITMAPINFO, _
  ByVal wUsage As Long, ByVal RasterOp As Long) As Long

Private Declare Function GetDIBits Lib "gdi32" (ByVal aHDC As Long, ByVal hBitmap As Long, ByVal nStartScan As Long, ByVal nNumScans As Long, lpBits As Any, lpBI As BITMAPINFO, ByVal wUsage As Long) As Long

Dim bi32BitInfo As BITMAPINFO
Dim OriginalImage() As Long, ParentImage() As Long

Private Function DIBRGB(ByVal c As Long) As Long
  DIBRGB = (c And &HFF&) * &H10000 Or (c And &HFF00&) Or (c And &HFF0000) \ &H10000
End Function

Public Sub DIBOpacy(Picture As Object, Parentpicture As Object, Alpha As Long, TransparentColor As Long, Optional PosX As Long = 0, Optional PosY As Long = 0)
    Dim inWidth As Long
    Dim inHeight As Long
    Dim SrcRed As Long, SrcBlue As Long, SrcGreen As Long
    Dim DstRed As Long, DstBlue As Long, DstGreen As Long
    Dim R As Long, G As Long, B As Long
    Dim x As Long, y As Long
   
    inWidth = Picture.ScaleWidth
    inHeight = Picture.ScaleHeight
    ReDim OriginalImage(inWidth - 1, inHeight - 1)
    ReDim ParentImage(inWidth - 1, inHeight - 1)
    With bi32BitInfo.bmiHeader
        .biBitCount = 32
        .biPlanes = 1
        .biSize = Len(bi32BitInfo.bmiHeader)
        .biWidth = inWidth
        .biHeight = inHeight
        .biSizeImage = 4 * inWidth * inHeight
    End With
    TransparentColor = DIBRGB(TransparentColor)
    GetDIBits Picture.hdc, Parentpicture.Image.Handle, 0, inHeight, OriginalImage(0, 0), bi32BitInfo, 0
    GetDIBits Parentpicture.hdc, Parentpicture.Image.Handle, 0, inHeight, ParentImage(0, 0), bi32BitInfo, 0
    Alpha = 255 - (Alpha * 255 / 100)
   
    For y = 0 To inHeight - 1
        For x = 0 To inWidth - 1
            If OriginalImage(x, y) <> TransparentColor Then
                DstBlue = ParentImage(x, y) And 255
                DstGreen = (ParentImage(x, y) And 65535) \ 256
                DstRed = (ParentImage(x, y) And &HFF0000) \ 65536
               
                SrcBlue = OriginalImage(x, y) And 255
                SrcGreen = (OriginalImage(x, y) And 65535) \ 256
                SrcRed = (OriginalImage(x, y) And &HFF0000) \ 65536
               
                R = (Alpha * (SrcRed + 256 - DstRed)) / 256 + DstRed - Alpha
                G = (Alpha * (SrcGreen + 256 - DstGreen)) / 256 + DstGreen - Alpha
                B = (Alpha * (SrcBlue + 256 - DstBlue)) / 256 + DstBlue - Alpha
                ParentImage(x, y) = RGB(R, G, B)
            Else
                ParentImage(x, y) = TransparentColor
            End If
        Next x
    Next y
   
    StretchDIBits Parentpicture.hdc, PosX, PosY, inWidth, inHeight, 0, 0, _
                        inWidth, inHeight, ParentImage(0, 0), bi32BitInfo, 0, vbSrcCopy
End Sub

is the RGB calculation correct?
(i must calculate the DIB pixel to RGB(in these case is BGR) for combine the 2 pixeles)

Ancient Direct3D7 in Windowed mode

0
0
Working the antique tilt here - for fun -
I need a Visual Basic 6 sample of initializing DirectX7 and Direct3D7 in windowed mode for comparison. :eek:
I have a few samples of full screen, but nothing in windowed mode.
As you may know, the SDK isn't available anywhere.
I have the old Jack Hoxley samples...
Thanks in advance.

DFD For Gameplay

0
0
guys im really lost for my project. i need to design dfd diagrams for my gameplay , actioms , levels.. there are 10 levels and only onstacles to avoid for character please help, as im really lost cant go forward

[Question] How to make a movable character in vB

0
0
Hi, I was planning on making a pokemon-esque "game" where I am able to move a retro styled character (sprite ripped from pokemon). I have about 16 or so different images that would be used for the walk cycles and such and was wondering how I would get this mapped to arrow keys so that when the buttons are pressed, the character image moves and the walk cycle commences. I would appreciate a fully mapped out code so I have something to work with. I was also curious as to how I could involve collision detection, since I want it so that when the character image bumps into a machine, a dialogue box comes up and asks if they want another form to pop up.:thumb:

[RESOLVED] Ancient Direct3D7 in Windowed mode

0
0
Working the antique tilt here - for fun -
I need a Visual Basic 6 sample of initializing DirectX7 and Direct3D7 in windowed mode for comparison. :eek:
I have a few samples of full screen, but nothing in windowed mode.
As you may know, the SDK isn't available anywhere.
I have the old Jack Hoxley samples...
Thanks in advance.

Blockbusters (Game Show)

0
0
Myself and another user (the latter of whom is no longer an active member) did work on a Blockbusters project as early as 2009, but further development was on hold for some time now due to another user's code being too complex.

While I do have experience with the text boxes, entering of answers, etc., I do not have much experience with the connecting of hexagons to allow for the round to be won.

Here is a video of a playing of Blockbusters:

http://www.youtube.com/watch?v=rbn67u0k6tc

If you notice the way the hexagons are connected, what would you recommend in order to allow for the hexagons to be connected to allow for a win?

Maybe it has to do with the adding up of certain Index numbers in an array plus that in order to win the game, the player would have to have a certain total or a minimum total when the winning connection is made, plus maybe connect a certain number of blocks as well?

What coding suggestions do you recommend for connecting the hexagons?

[VB.NET] Battle Message Project

0
0
Hello everyone, I am an aspiring indie game developer seeking to share my vision with other programmers. I plan on releasing a proof-of-concept build for a game I am developing that has been dubbed the 'Battle Message Project'. This name is temporary, but fits the game quite well atm until I decide on a permanent title.

The Idea

Chat programs are an important lifeline for the online community. Millions of people use programs like Skype, MSN/Live messenger, yahoo, AIM, and countless other chat services to communicate with long-distance gamers, friends, and other colleagues. While some forums offer rpg-style arcade games, and messengers like yahoo have puzzle and board games like scrabble and chess, I feel there is an untouched audience for messenger/game hybrids.

I've always been interested in developing games, but i've also been interested in developing communications programs (my first being a realtime chat program between pc and phones using sms). Now, I aim to make a hybrid that offers interesting content, replay value, multiplayer content, and most importantly, simple and smooth chat functionality.

So far..

I won't go into much detail on gameplay or mechanics, but a taste of what is implemented so far:

Custom Spells! - Start with a blank slate, and build your spells from the ground up. Create a Heal-over-Time that also stuns the enemy, or an ability that absorbs damage, only to reflect it later back at the attacker!

Masteries - The stats you gain when you level up depend on your play style. If you enjoy life-steal based attacks, 'Death Mastery' will allow you to benefit from melee abilities more and grant health and strength apon levelup.

Combo-System - Firebolt may deal damage, but combining it with the right mastery will add a Damage-over-Time effect. Combining it with combat styles accordingly may add an additional stun effect. There will be tons of hidden spell/mastery/combat style combinations for you to discover!

All of this, with a messaging system at your fingertips that will be more lightweight then MSN or yahoo.

But, the point of this post isn't to reveal or advertise my game. I need feedback on what makes good gameplay. Personally, I look for customization options in the games I play because I like to think of my character as 'unique'. I do not currently need feedback regarding graphics-related material. I intend for this to be a 2D application to retain functionality as a messaging program.

tl;dr What makes you want to continue playing a game?

[RESOLVED] [VB6- DIB's] - transparent opacy by pixel

0
0
i rebuild my code for do the opacy.
but i don't understand why takes so many time and the results aren't what i expected:(
Code:

Option Explicit

Private Type BITMAPINFOHEADER
  biSize As Long
  biWidth As Long
  biHeight As Long
  biPlanes As Integer
  biBitCount As Integer
  biCompression As Long
  biSizeImage As Long
  biXPelsPerMeter As Double
  biClrUsed As Double
End Type

Private Type BITMAPINFO
  bmiHeader As BITMAPINFOHEADER
  bmiColors As Long
End Type

Private Declare Function StretchDIBits Lib "gdi32" (ByVal hdc As Long, _
  ByVal x As Long, ByVal y As Long, ByVal dWidth As Long, ByVal dHeight _
  As Long, ByVal SrcX As Long, ByVal SrcY As Long, ByVal SrcWidth As _
  Long, ByVal SrcHeight As Long, lpBits As Any, lpBI As BITMAPINFO, _
  ByVal wUsage As Long, ByVal RasterOp As Long) As Long

Private Declare Function GetDIBits Lib "gdi32" (ByVal aHDC As Long, ByVal hBitmap As Long, ByVal nStartScan As Long, ByVal nNumScans As Long, lpBits As Any, lpBI As BITMAPINFO, ByVal wUsage As Long) As Long

Dim bi32BitInfo As BITMAPINFO
Dim OriginalImage() As Long, ParentImage() As Long

Private Function DIBRGB(ByVal c As Long) As Long
  DIBRGB = (c And &HFF&) * &H10000 Or (c And &HFF00&) Or (c And &HFF0000) \ &H10000
End Function

Public Sub DIBOpacy(Picture As Object, Parentpicture As Object, Alpha As Long, TransparentColor As Long, Optional PosX As Long = 0, Optional PosY As Long = 0)
    Dim inWidth As Long
    Dim inHeight As Long
    Dim SrcRed As Long, SrcBlue As Long, SrcGreen As Long
    Dim DstRed As Long, DstBlue As Long, DstGreen As Long
    Dim R As Long, G As Long, B As Long
    Dim x As Long, y As Long
   
    inWidth = Picture.ScaleWidth
    inHeight = Picture.ScaleHeight
    ReDim OriginalImage(inWidth - 1, inHeight - 1)
    ReDim ParentImage(inWidth - 1, inHeight - 1)
    With bi32BitInfo.bmiHeader
        .biBitCount = 32
        .biPlanes = 1
        .biSize = Len(bi32BitInfo.bmiHeader)
        .biWidth = inWidth
        .biHeight = inHeight
        .biSizeImage = 4 * inWidth * inHeight
    End With
    TransparentColor = DIBRGB(TransparentColor)
    GetDIBits Picture.hdc, Parentpicture.Image.Handle, 0, inHeight, OriginalImage(0, 0), bi32BitInfo, 0
    GetDIBits Parentpicture.hdc, Parentpicture.Image.Handle, 0, inHeight, ParentImage(0, 0), bi32BitInfo, 0
    Alpha = 255 - (Alpha * 255 / 100)
   
    For y = 0 To inHeight - 1
        For x = 0 To inWidth - 1
            If OriginalImage(x, y) <> TransparentColor Then
                DstBlue = ParentImage(x, y) And 255
                DstGreen = (ParentImage(x, y) And 65535) \ 256
                DstRed = (ParentImage(x, y) And &HFF0000) \ 65536
               
                SrcBlue = OriginalImage(x, y) And 255
                SrcGreen = (OriginalImage(x, y) And 65535) \ 256
                SrcRed = (OriginalImage(x, y) And &HFF0000) \ 65536
               
                R = (Alpha * (SrcRed + 256 - DstRed)) / 256 + DstRed - Alpha
                G = (Alpha * (SrcGreen + 256 - DstGreen)) / 256 + DstGreen - Alpha
                B = (Alpha * (SrcBlue + 256 - DstBlue)) / 256 + DstBlue - Alpha
                ParentImage(x, y) = RGB(R, G, B)
            Else
                ParentImage(x, y) = TransparentColor
            End If
        Next x
    Next y
   
    StretchDIBits Parentpicture.hdc, PosX, PosY, inWidth, inHeight, 0, 0, _
                        inWidth, inHeight, ParentImage(0, 0), bi32BitInfo, 0, vbSrcCopy
End Sub

is the RGB calculation correct?
(i must calculate the DIB pixel to RGB(in these case is BGR) for combine the 2 pixeles)

Hamgman game help!

0
0
hi , im so new to this. but i need help. so i have this game as a project and its hangman. i need help with making the points work. can anybody help?

Hamgman game help!please

0
0
i need help on programming the points in my game to work. also i made a version where the computer guesses the letters of a word, and the letters that are already guessed repeats , so i need a way to prevent that. somebody please help me! its due tomorrow!! :(

Shuffling array

0
0
SO I've got a large lump of code used in a 4 card concentration type game. One problem, the cards are always in the same location. I know I need some sort of shuffling array to randomize/shuffle the cards, unfortunately I have no idea how to do this. Is there any way one of you could help me out?
More info: the shuffle would be in a btnshuffle click event.

Code so far:

Public Class Form1
Dim cards() As Boolean = {True, True, False, False}
Dim card0f, card1f, card2f, card3f As Boolean
Dim cardsFlipped As Integer
Private Sub pbcard0_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pbcard0.Click
If card0f = True Then
pbcard0.Image = My.Resources.CardBack
card0f = False
cardsFlipped = cardsFlipped - 1
Else
If cardsFlipped < 2 Then
card0f = True
cardsFlipped = cardsFlipped + 1
If cards(0) = True Then
pbcard0.Image = My.Resources.smiley_face
Else
pbcard0.Image = My.Resources.star
End If
CheckCards()
End If
End If
End Sub
Public Sub CheckCards()
If cardsFlipped = 2 Then
cardsFlipped = 0
If card0f = True Then
If card1f = True Then
If cards(0) = cards(1) Then
MsgBox("YOU HAVE A MATCH")
pbcard0.Visible = False
pbcard1.Visible = False
card0f = False
card1f = False
Else
MsgBox("YOU DONT HAVE A MATCH")
card0f = False
card1f = False
pbcard0.Image = My.Resources.CardBack
pbcard1.Image = My.Resources.CardBack
End If
End If
If card2f = True Then
If cards(0) = cards(2) Then
MsgBox("YOU HAVE A MATCH")
pbcard0.Visible = False
pbcard2.Visible = False
card0f = False
card2f = False
Else
MsgBox("YOU DONT HAVE A MATCH")
card0f = False
card2f = False
pbcard0.Image = My.Resources.CardBack
pbcard2.Image = My.Resources.CardBack
End If
End If
If card3f = True Then
If cards(0) = cards(3) Then
MsgBox("YOU HAVE A MATCH")
pbcard0.Visible = False
pbcard3.Visible = False
card0f = False
card3f = False
Else
MsgBox("YOU DONT HAVE A MATCH")
card0f = False
card3f = False
pbcard0.Image = My.Resources.CardBack
pbcard3.Image = My.Resources.CardBack
End If
End If
ElseIf card1f = True Then
If card2f = True Then
If cards(1) = cards(2) Then
MsgBox("YOU HAVE A MATCH")
pbcard1.Visible = False
pbcard2.Visible = False
card1f = False
card2f = False
Else
MsgBox("YOU DONT HAVE A MATCH")
card1f = False
card2f = False
pbcard1.Image = My.Resources.CardBack
pbcard2.Image = My.Resources.CardBack
End If
End If
If card3f = True Then
If cards(1) = cards(3) Then
MsgBox("YOU HAVE A MATCH")
pbcard1.Visible = False
pbcard3.Visible = False
card1f = False
card3f = False
Else
MsgBox("YOU DONT HAVE A MATCH")
card1f = False
card3f = False
pbcard1.Image = My.Resources.CardBack
pbcard3.Image = My.Resources.CardBack
End If
End If
ElseIf card2f = True Then
If card3f = True Then
If cards(2) = cards(3) Then
MsgBox("YOU HAVE A MATCH")
pbcard2.Visible = False
pbcard3.Visible = False
card2f = False
card3f = False
Else
MsgBox("YOU DONT HAVE A MATCH")
card2f = False
card3f = False
pbcard2.Image = My.Resources.CardBack
pbcard3.Image = My.Resources.CardBack
End If
End If
End If
If pbcard0.Visible = False And pbcard1.Visible = False And pbcard2.Visible = False And pbcard3.Visible = False Then
MsgBox("YOU WIN!!!")
End If
End If
End Sub

Private Sub pbcard1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pbcard1.Click
If card1f = True Then
pbcard1.Image = My.Resources.CardBack
card1f = False
cardsFlipped = cardsFlipped - 1
Else
If cardsFlipped < 2 Then
card1f = True
cardsFlipped = cardsFlipped + 1
If cards(1) = True Then
pbcard1.Image = My.Resources.smiley_face
Else
pbcard1.Image = My.Resources.star
End If
CheckCards()
End If
End If
End Sub

Private Sub pbcard2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pbcard2.Click
If card2f = True Then
pbcard2.Image = My.Resources.CardBack
card2f = False
cardsFlipped = cardsFlipped - 1
Else
If cardsFlipped < 2 Then
card2f = True
cardsFlipped = cardsFlipped + 1
If cards(2) = True Then
pbcard2.Image = My.Resources.smiley_face
Else
pbcard2.Image = My.Resources.star
End If
CheckCards()
End If
End If
End Sub

Private Sub pbcard3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pbcard3.Click
If card3f = True Then
pbcard3.Image = My.Resources.CardBack
card3f = False
cardsFlipped = cardsFlipped - 1
Else
If cardsFlipped < 2 Then
card3f = True
cardsFlipped = cardsFlipped + 1
If cards(3) = True Then
pbcard3.Image = My.Resources.smiley_face
Else
pbcard3.Image = My.Resources.star
End If
CheckCards()
End If
End If
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
card0f = False
card2f = False
card3f = False
card1f = False
pbcard0.Image = My.Resources.CardBack
pbcard1.Image = My.Resources.CardBack
pbcard2.Image = My.Resources.CardBack
pbcard3.Image = My.Resources.CardBack

End Sub
End Class

[VB.NET] Help with hex map logic

0
0
Hi All,
Sorry if there is already a thread on this I have tried the search engine but couldn't find anything relevant.

My (noob) question concerns using a hexmap that is bigger than the form I'm using to display it and how to scroll through it.

The map itself is of fixed size (19/61); because I want the individual hexes to be quite large the whole map is much bigger than the form I can display on my laptop. I have code to draw the hexmap as graphics objects (using draw polygon and fillpolygon) and it works well for the visible area. In order to force the scroll bars to appear I've placed a button at an x,y position just further away than the farthest bottom corner of the final hex. My issue is that the only part of the map that displays is the section that would be visible on the unscrolled part of the form.

I think my problem is more to do with the logic of how I implement the map. Should I be creating graphics objects and somehow redrawing correct hexes as the scroll bars move or should I be creating a bitmap and updating it every time I make a change? Or is there a more elegant solution?

The hexes themselves will change colour to show who owns them plus display which forces are currently in the hex.

Any help would be appreciated.

Welchbloke

[RESOLVED] directx or xna

0
0
DirectX is no longer supported by microsoft, therefor I can't use it(I use vb.net 2010). XNA looks as though microsoft is trying to get away from supporting that as well. So my question is: Should I go with DirectX or XNA? If DirectX, should I use slimdx or sharpdx?

Black Jack Test

0
0
Im trying to create a Black Jack Testing game. The concept is that you are given three cards out of 52 at random, 2 are the players and 1 is the dealers. There are four buttons available: Hit, Stay, Double, Split. When the player sees the three cards he should hit one of the buttons, if the right button is clicked a new random set of three cards are shown. If the player selects the wrong button a message will say wrong and the player will guess again, once he chooses the right option 3 new cards are shown at random.

Currently I have created a new dictionary and loaded 52 images from My.Resourses:
Private imgList As New Dictionary(Of String, Bitmap)

I have all my images loaded and when I select the deal button 3 cards are all shown at random. The part I'm stuck on is how to create an If Then statement when the user selects the Hit/Stay/Double/Split option based on the images that are shown.

How can I give images that are shown randomly a value that can be used in an If Then statement of a users selection?

[VB 6] GDI+ and PNG with transparency

0
0
Hi,

I decided to post my question on this site after seeing all the impressive work by LaVolte and the many discussions around it.

BACKGROUND
My application allows users to manipulate images on-screen by dragging and dropping them in different locations. To do that most efficiently, it loads initially all images (from files) in a collection (properties: ID, Filename, Picture) and references the collection every time the screen needs to be redrawn. The Picture property in the collection is a StdPicture which is filled with the LoadPicture method, so I limited the image-formats to jpg and emf (for transparency support). The images are drawn on a PictureBox using the PaintPicture method, allowing it to be drawn in a different size than the original.

WISH
I like the application to support png-files incl. transparency. So, I thought to be clever and do that by using GDI+ to load the png-file and then converting it to the StdPicture in the collection, so that I could leave the rest of the application untouched. Unfortunately I lose transparency in that process. :-(

QUESTION
Does anyone have a suggestion how I could achieve png with transparency support while keeping the current structure of my application? Maybe I’m oversimplifying, but could it be something like defining the Picture property in the collection as a “GDIPlusPicture” and using a “GDIPlusPaintPicture” method to draw them?

Maybe the answer has already been given before, but I couldn’t distill it from the great, but sometimes overwhelming amount of info on GDI+, png, etc. that is available on this site…

Regards,
Erwin

[VB 6] - resolution a form

0
0
i understand that i can't resolution my form by API, only the screen. but i need 1 advice for calculations.
i can resize the form, but i don't understand how can i change the controls sizes\positions, can anyone give 1 light for these?

[RESOLVED] Dividing a circle

0
0
Hi there!
I’m having big trouble trying to design some stimuli for a visual experiment. Mainly because programming (and maths) is not my strong point, plus I’m not even sure if VB can do what I need…

Anyways, I’ve managed to draw a centred circle with specific parameters and a fixation point in the middle, but what I now need is to divide it into 6 equal parts by passing a line through each equally spaced point and the centre. While I know how to do that with a protractor on a piece of paper, I have no clue how to do it in code :confused: And it pains me to think this is just the simplest manipulation I need to do in order to draw this stimulus. I’m trying to take it one step at a time and figure out as much as I can on my own, but unfortunately time is against me :cry:. I’d appreciate any help, suggestions, advice… Thank you all!

PS: I’m using VB 6.0 and only have basic beginner knowledge.

[VB.NET] XNA - Game Loop

0
0
I've been looking at some tutorials on youtube and I noticed something that they all have in common. For the game loop they run an infinate loop calling the proper graphicsdevice methods, but also calling application.doevents eg:
Code:

        'grafix is my graphicsdevice
        Do While True = True
            grafix.Clear(Color.CornflowerBlue)
            grafix.Present()

            Application.DoEvents()
        Loop

I know for a fact that calling application.doevents in an infinate loop is dangerous. So my question is, what should I do instead of that?
Viewing all 263 articles
Browse latest View live




Latest Images