|
-
Nov 2nd, 2009, 09:34 PM
#1
Thread Starter
Junior Member
Avatars
I need an avatar position retention method to save where a user's avatar is, relative to the screen width/height, so when the window is resized, the user's avatar will stay in the same position that it was in before the window was resized either smaller or larger.
-
Nov 3rd, 2009, 01:56 AM
#2
Re: Avatars
What is the avatar contained in? A picturebox on a form? Need more information
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Nov 3rd, 2009, 02:22 AM
#3
Thread Starter
Junior Member
Re: Avatars
They're contained inside one bigger picturebox, I will post a screenshot of my client below.
Last edited by Word; Nov 3rd, 2009 at 02:36 AM.
-
Nov 3rd, 2009, 03:15 AM
#4
Re: Avatars
Ok but when the form is resized you want the avatar to stay where? Why would it move if you resize the form?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Nov 3rd, 2009, 03:21 AM
#5
Thread Starter
Junior Member
Re: Avatars
Well say theres like 20 people logged in, their avatars in all different positions, and when the client is resized i want each av to retain the position they're in depending on the size, for instance i'm in the middle with it maximized in the screenshot, but if i normalize it and resize the form i want my avatar to stay in the center. Same as if there was more avatars, they would all remain in the same spot no matter what size the container is.
Does that make sense? lol
-
Nov 3rd, 2009, 03:25 AM
#6
Re: Avatars
[color=navy]Soulds like maybe you should be using a ListView in large icon view instead. It would be alot easier as it has built in alignment properties.
If not, then you will have to save the location of each avatar and position as you desire.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Nov 3rd, 2009, 03:28 AM
#7
Thread Starter
Junior Member
Re: Avatars
I have to use a picture box, because the avatars are moveable. I know that I need to store each of their positions, but I need help doing so, and then keeping them in the position. I suck at math, and have tried everything, but get horrible results.
-
Nov 3rd, 2009, 05:43 PM
#8
Thread Starter
Junior Member
Re: Avatars
So far I have come up with the code below, but I cannot get it working correctly. It keeps my avatar in position for the most part, but there seems to be a problem with correcting the old position of the other avatars...
Code:
Dim tmpVarY As Long, tmpVarX As Long, boxLarger As Boolean
boxLarger = False
If picBoxHeight < .picBox.Height Then
tmpVarY = .picBox.Height - picBoxHeight
boxLarger = True
Else
tmpVarY = picBoxHeight - .picBox.Height
End If
If picBoxWidth < .picBox.Width Then
tmpVarX = .picBox.Width - picBoxWidth
boxLarger = True
Else
tmpVarX = picBoxWidth - .picBox.Width
End If
For i = 0 To .picAv.UBound
.picAv(i).Top = IIf(boxLarger = True, Chatter(i).userY + tmpVarY, Chatter(i).userY - tmpVarY)
.picAv(i).Left = IIf(boxLarger = True, Chatter(i).userX + tmpVarX, Chatter(i).userX - tmpVarX)
If .picAv(i).Left + .picAv(i).Width >= .picBox.Width Then
.picAv(i).Left = .picBox.Width - .picAv(i).Width
End If
If .picAv(i).Top + .picAv(i).Height >= .picBox.Height Then
.picAv(i).Top = .picBox.Height - .picAv(i).Height
End If
If .picAv(i).Top > Chatter(i).userYOld Then
.picAv(i).Top = Chatter(i).userYOld
End If
If .picAv(i).Left > Chatter(i).userXOld Then
.picAv(i).Left = Chatter(i).userXOld
End If
Chatter(i).userY = .picAv(i).Top
Chatter(i).userX = .picAv(i).Left
frmMain.checkAvatar i
Next i
-
Nov 3rd, 2009, 11:08 PM
#9
PowerPoster
Re: Avatars
Code:
Dim Item1 As Long
Dim Item2 As Long
Form1.Picture1.Top = Item1
Form1.Picture1.Left = Item2
I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...
|Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |
Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...
-
Nov 4th, 2009, 06:14 PM
#10
Thread Starter
Junior Member
-
Nov 4th, 2009, 07:27 PM
#11
PowerPoster
Re: Avatars
To make the PictureBox retain its position, when you have resized the Form. You have to maybe look into the ScaleWidth and ScaleHeight properties, in the Form_Resize handler. You have to set them at run-time, and set values to them.
I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...
|Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |
Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|