Click here to Skip to main content
15,877,103 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: VB6 vs VB.NET Windows Forms and Controls Handling Behavior Pin
dan!sh 25-Jun-09 8:15
professional dan!sh 25-Jun-09 8:15 
AnswerRe: VB6 vs VB.NET Windows Forms and Controls Handling Behavior Pin
Gideon Engelberth25-Jun-09 9:32
Gideon Engelberth25-Jun-09 9:32 
Questionproperty selected and load other items in other properties Pin
VB 8.025-Jun-09 4:01
VB 8.025-Jun-09 4:01 
AnswerRe: property selected and load other items in other properties Pin
Jon_Boy25-Jun-09 4:09
Jon_Boy25-Jun-09 4:09 
GeneralRe: property selected and load other items in other properties Pin
VB 8.026-Jun-09 2:22
VB 8.026-Jun-09 2:22 
Questionsoliworks image Pin
bhargava240925-Jun-09 2:04
bhargava240925-Jun-09 2:04 
AnswerRe: soliworks image Pin
Jon_Boy25-Jun-09 2:26
Jon_Boy25-Jun-09 2:26 
QuestionGDI+ problem? Pin
O.G.I.25-Jun-09 0:59
O.G.I.25-Jun-09 0:59 
Hi,
I'm currently working on a 2D game engine for my RPG. Now the work on the physics engine is almost done, but the graphics are seems to be the biggest problem. I'm using VB 2008 and for the graphics - GDI+ . Almost all of the objects in my game are *png images, with smooth shadows and so on... I'm drawing the objects using two methods: the first one sets the drawing priority so that no one player can step on the head of other players. The second one is the loop that draws all the objects(players and textures) on the playground, that loop uses the GDI+ Graphics.DrawImage function and all this code looks like this:

'this subroutine sets the draw priority:
Sub SetObjDrawPriority()
For i = 0 To UBound(HBD)
Select Case HBD(i).booIsAlive
Case True
intDrawPriority(i) = HBD(i).intTop
End Select
Next
Array.Sort(intDrawPriority)
End Sub

Sub DrawAllObjects(ByVal e As System.Windows.Forms.PaintEventArgs)
Try
SetObjDrawPriority()
For i = 0 To UBound(HBD)
For i2 = 0 To UBound(HBD)
If HBD(i2).intTop = intDrawPriority(i) Then
e.Graphics.DrawImage(HBD(i2).bmpFace, HBD(i2).intLeft, _
HBD(i2).intDrawTop, HBD(i2).intWidth, HBD(i2).intObjDrawHeight)
End If
Next
Next
Catch ex As Exception
End Try
End Sub

If I use *bmp texture for the objects with this size: 51 x 86 I can move simultaneously more than 200 objects on the visible area of the screen which is great, but If I replace the *bmp with *png images(with the same size: 51 x 86) the performance goes so bad that I can move normally less than 40 objects! Please tell me whats wrong. Is there any problem with the GDI+? I heard that GDI+ is wery slow and most of the programmers avoid it. I think that the code is pretty simple, but anyway maybe I'm wrong, please tell me how to optimize the code in case to get better performance.
Thank you.
AnswerRe: GDI+ problem? Pin
Thomas Krojer25-Jun-09 1:07
Thomas Krojer25-Jun-09 1:07 
AnswerRe: GDI+ problem? Pin
Dave Kreskowiak25-Jun-09 4:12
mveDave Kreskowiak25-Jun-09 4:12 
AnswerRe: GDI+ problem? Pin
O.G.I.25-Jun-09 4:20
O.G.I.25-Jun-09 4:20 
GeneralRe: GDI+ problem? Pin
Jon_Boy25-Jun-09 4:30
Jon_Boy25-Jun-09 4:30 
GeneralRe: GDI+ problem? [modified] Pin
Luc Pattyn25-Jun-09 4:36
sitebuilderLuc Pattyn25-Jun-09 4:36 
Questiontree view node click event Pin
bhargava240925-Jun-09 0:11
bhargava240925-Jun-09 0:11 
AnswerRe: tree view node click event Pin
dan!sh 25-Jun-09 1:11
professional dan!sh 25-Jun-09 1:11 
GeneralRe: tree view node click event Pin
bhargava240925-Jun-09 1:16
bhargava240925-Jun-09 1:16 
GeneralRe: tree view node click event Pin
Jon_Boy25-Jun-09 1:39
Jon_Boy25-Jun-09 1:39 
GeneralRe: tree view node click event Pin
bhargava240925-Jun-09 1:59
bhargava240925-Jun-09 1:59 
GeneralRe: tree view node click event Pin
bhargava240925-Jun-09 2:00
bhargava240925-Jun-09 2:00 
GeneralRe: tree view node click event Pin
Jon_Boy25-Jun-09 2:08
Jon_Boy25-Jun-09 2:08 
GeneralRe: tree view node click event Pin
bhargava240925-Jun-09 2:27
bhargava240925-Jun-09 2:27 
GeneralRe: tree view node click event Pin
dan!sh 25-Jun-09 1:59
professional dan!sh 25-Jun-09 1:59 
QuestionLink dialog (Hyperlink) Pin
jinxster24-Jun-09 15:37
professionaljinxster24-Jun-09 15:37 
AnswerRe: Link dialog (Hyperlink) Pin
Christian Graus24-Jun-09 16:20
protectorChristian Graus24-Jun-09 16:20 
GeneralRe: Link dialog (Hyperlink) Pin
jinxster24-Jun-09 19:05
professionaljinxster24-Jun-09 19:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.