Click here to Skip to main content
16,005,281 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralAs Any Data Type Pin
Michael Cocozza17-Jul-01 4:32
Michael Cocozza17-Jul-01 4:32 
GeneralRe: As Any Data Type Pin
27-Jul-01 13:51
suss27-Jul-01 13:51 
GeneralRe: As Any Data Type Pin
Klaus Probst7-Aug-01 15:41
Klaus Probst7-Aug-01 15:41 
GeneralVB/VBA and C++ classes Pin
Alberto Bar-Noy17-Jul-01 4:23
Alberto Bar-Noy17-Jul-01 4:23 
GeneralRe: VB/VBA and C++ classes Pin
Ulf Öhlén18-Jul-01 23:16
Ulf Öhlén18-Jul-01 23:16 
GeneralRe: VB/VBA and C++ classes Pin
Klaus Probst7-Aug-01 16:00
Klaus Probst7-Aug-01 16:00 
GeneralDrawing things Pin
16-Jul-01 11:56
suss16-Jul-01 11:56 
GeneralRe: Drawing things FAST Pin
CodeCrafty®17-Jul-01 21:59
CodeCrafty®17-Jul-01 21:59 
I don't have time to do the details... but,
to give you a clue: What you need to do is host the directx7 library by making a 'reference (via the object browser) first, even though the machines use DX8 'cause thats where direct draw is, OK?
In your code you'll have to:

option explicit
Private MyDX7 as NEW vbDXlib.DirectX7
Private MyDirectDraw as vbDXlib.DirectDraw7

sub Form1_OnLoad()
set MyDirectDraw = MyDX7.DreateDirectDraw7

yadda...yadda..yadda...
the trick is that DX7 HAS to be created 'as new'
THEN you get DirectDraw (in-directly) Smile | :) which you then use some UserDefinedTypes (UDT's) to initialize a 'primary_surface' and the 1st 'offscreen_surface'. All this just to get a page flippin scheme so your stuff draws REAL_FAST... before you call your bitmap (of any shape you desire) into a 2nd 'offscreen_surface' using:
MyDirectDraw.CreateSurfaceFromFile(bla,bla,bla)
-which is a holder in memory for your 'sprite' as some call would say. You then use DirectDraw's
super cool graphics methods to paint rotated versions of the sprite (to the current degree) on a 4th 'offscreen_surface' before dumping that 4th surface to the 1st 'offscreen' surface, so that the picture will be there when the 'Form1_repaint' is called by the Operating_Sys or your animating timer control's ticker event.... Get the DirectX8 sdk and look at the vb-Billboard sample. Really, it shows you exactly what you are trying to do 'cept they made their whirly-gig go in a circle. You'll have to do the bouncing yourself, but the hard parts will be taken care of. You'll be pleasently supprised with the performance, even on a 200mmx or so you could get >45 fps especially if you have a flat color (black?) background so you don't have to clip.
PS: Try using this basic structure for gradient backgrounds, use a 128x128 bitmap created in say... ulead photoImpact's magic gradient (they have a 30 day demo for free) or other graphics package. That size is great 'cause you won't see ANY pixel lines even when the form streches it full screen, unlike the windows desktop... and it re-paints faster than you can do a loop! »geeky ain't I... Smile | :)

CodeCrafty®
nauhaus@swbell.net
GeneralRe: Drawing things FAST Pin
Cem Kalyoncu7-Aug-01 12:16
Cem Kalyoncu7-Aug-01 12:16 
GeneralRe: Drawing things FAST Pin
Klaus Probst7-Aug-01 15:45
Klaus Probst7-Aug-01 15:45 
QuestionResource limits?? Pin
Austin Jones16-Jul-01 11:15
Austin Jones16-Jul-01 11:15 
GeneralVB COM Testing Pin
amitrgholap16-Jul-01 1:09
amitrgholap16-Jul-01 1:09 
GeneralDAO Pin
sripriyaunni15-Jul-01 20:08
sripriyaunni15-Jul-01 20:08 
GeneralRe: DAO Pin
Fariborz4-Aug-01 6:22
Fariborz4-Aug-01 6:22 
Generalstart options of MS IE5.5 Pin
9-Jul-01 7:20
suss9-Jul-01 7:20 
GeneralRe: start options of MS IE5.5 Pin
9-Jul-01 11:07
suss9-Jul-01 11:07 
GeneralExcel formulae Pin
Ian5-Jul-01 20:38
Ian5-Jul-01 20:38 
Generalright click and refresh Pin
Ian3-Jul-01 22:55
Ian3-Jul-01 22:55 
Generalmail attach Pin
3-Jul-01 13:37
suss3-Jul-01 13:37 
GeneralCode Editor for VB Pin
James Stigler3-Jul-01 12:11
James Stigler3-Jul-01 12:11 
GeneralRe: Code Editor for VB Pin
CodeCrafty®17-Jul-01 22:13
CodeCrafty®17-Jul-01 22:13 
GeneralGet selected row from a DBGrid control Pin
Ameenudeen2-Jul-01 14:51
Ameenudeen2-Jul-01 14:51 
GeneralPages in tif Image Pin
28-Jun-01 0:28
suss28-Jun-01 0:28 
Generalpivot table Pin
tamar yona27-Jun-01 20:07
tamar yona27-Jun-01 20:07 
GeneralEvents with an MTS COM object. Pin
Jamie Nordmeyer27-Jun-01 6:01
Jamie Nordmeyer27-Jun-01 6:01 

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.