DirectX Loading Pictures From Resource File
DirectX Loading Pictures From Resource File
DirectX Loading Pictures From Resource File
DirectX Loading Pictures From Resource File
DirectX Loading Pictures From Resource File
DirectX Loading Pictures From Resource File DirectX Loading Pictures From Resource File DirectX Loading Pictures From Resource File DirectX Loading Pictures From Resource File DirectX Loading Pictures From Resource File DirectX Loading Pictures From Resource File DirectX Loading Pictures From Resource File DirectX Loading Pictures From Resource File
DirectX Loading Pictures From Resource File DirectX Loading Pictures From Resource File
DirectX Loading Pictures From Resource File
Go Back  Xtreme Visual Basic Talk > > > > DirectX Loading Pictures From Resource File


Reply
 
Thread Tools Display Modes
  #1  
Old 06-07-2013, 10:08 AM
DMF DMF is offline
Newcomer
 
Join Date: May 2013
Posts: 2
Default DirectX Loading Pictures From Resource File


Edit by Moderator: Re: directx loading pictures from resource file
i cant understand half of what you said. but, i need todo this with dx8 , almost all of the images needed for dx8 part are png.

this is the drawing sub for textures

Public Sub RenderTexture(ByRef TextureRec As DX8TextureRec, ByVal dX As Single, ByVal dY As Single, ByVal sX As Single, ByVal sY As Single, ByVal dWidth As Single, ByVal dHeight As Single, ByVal sWidth As Single, ByVal sHeight As Single, Optional Color As Long = -1)
Dim TextureNum As Long
Dim textureWidth As Long, textureHeight As Long, sourceX As Single, sourceY As Single, sourceWidth As Single, sourceHeight As Single

SetTexture TextureRec

TextureNum = TextureRec.Texture

textureWidth = gTexture(TextureNum).TexWidth
textureHeight = gTexture(TextureNum).TexHeight

If sY + sHeight > textureHeight Then Exit Sub
If sX + sWidth > textureWidth Then Exit Sub
If sX < 0 Then Exit Sub
If sY < 0 Then Exit Sub

sX = sX - 0.5
sY = sY - 0.5
dY = dY - 0.5
dX = dX - 0.5
sWidth = sWidth
sHeight = sHeight
dWidth = dWidth
dHeight = dHeight
sourceX = (sX / textureWidth)
sourceY = (sY / textureHeight)
sourceWidth = ((sX + sWidth) / textureWidth)
sourceHeight = ((sY + sHeight) / textureHeight)

Vertex_List(0) = Create_TLVertex(dX, dY, 0, 1, Color, 0, sourceX + 0.000003, sourceY + 0.000003)
Vertex_List(1) = Create_TLVertex(dX + dWidth, dY, 0, 1, Color, 0, sourceWidth + 0.000003, sourceY + 0.000003)
Vertex_List(2) = Create_TLVertex(dX, dY + dHeight, 0, 1, Color, 0, sourceX + 0.000003, sourceHeight + 0.000003)
Vertex_List(3) = Create_TLVertex(dX + dWidth, dY + dHeight, 0, 1, Color, 0, sourceWidth + 0.000003, sourceHeight + 0.000003)

Direct3D_Device.SetTexture 0, gTexture(TextureNum).Texture
Direct3D_Device.DrawPrimitiveUP D3DPT_TRIANGLESTRIP, 2, Vertex_List(0), Len(Vertex_List(0))
End Sub


how its used is like dis(Tex_Gui() some how refering to the folder gui/#.png . the # is number of the gui number.)

Width = Width of image
Height = Height of Image
X = X location
Y = Y location
RenderTexture Tex_GUI(#), X, Y, 0, 0, Width, Height, Width, Height

idk, but if you got some idea, please tell me.
Edit by Moderator: I've created a link to the original thread for you (which is more that 30 days old). Please have a look at our Posting Guidelines when you have a chance. Thanks, and welcome to the forum.

Last edited by Cerian Knight; 06-10-2013 at 05:17 PM.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
DirectX Loading Pictures From Resource File
DirectX Loading Pictures From Resource File
DirectX Loading Pictures From Resource File DirectX Loading Pictures From Resource File
DirectX Loading Pictures From Resource File
DirectX Loading Pictures From Resource File
DirectX Loading Pictures From Resource File DirectX Loading Pictures From Resource File DirectX Loading Pictures From Resource File DirectX Loading Pictures From Resource File DirectX Loading Pictures From Resource File DirectX Loading Pictures From Resource File DirectX Loading Pictures From Resource File
DirectX Loading Pictures From Resource File
DirectX Loading Pictures From Resource File
 
DirectX Loading Pictures From Resource File
DirectX Loading Pictures From Resource File
 
-->