15,902,189 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by strangerick (Top 28 by date)
strangerick
18-Sep-21 7:31am
View
I need the sprites to be sliced automatically based on their size and the current resolution of the screen so they don't get stretched when drawing to different resolutions.
strangerick
18-Sep-21 7:17am
View
Hello and thanks for the comment. The code posted in my previous question works but i need something more advanced for my needs, that's why i'm searching for a more complete library.
strangerick
15-Sep-21 10:42am
View
Hey, thanks for the comment. I happened to fix the problem by changing some values and modifying the code a bit, so thanks for the answer, it works now.
strangerick
15-Sep-21 9:12am
View
This code seems to only tile the texture, not slice them into smaller textures the way i need. What can i do to accomplish this?
strangerick
15-Sep-21 8:36am
View
Hey, sorry for bothering, your method works but there is one part of the image missing and sometimes it just tiles the texture i don't know why, could you explain how to use it properly or improve it?
i'm drawing it like this:
var rect = new RectangleF(0, 0, 512, 512);
var cells = RectFToRectsF(rect, 3, 3);
foreach (var cell in cells)
{
e.Graphics.DrawImage(texture, rect, cell, GraphicsUnit.Pixel);
}
The image i'm drawing now is 190x49.
strangerick
15-Sep-21 8:28am
View
This seemed like the easiest way of doing it.
strangerick
25-Aug-21 13:10pm
View
Hello, thanks for the answer but the thumb size has nothing to do with the question in hand, I also tried applying it to the positions but it did not worked.
As I wrote in the original post:
. Calculate the Thumb and Content "LOCAL POSITIONS".
. Then, when the Viewport is MOVED: the Thumb and Content should always KEEP THEIR LOCAL POSITIONS IN RELATION TO THE NEW VIEWPORT POSITION.
Could you please edit your answer?
strangerick
25-Aug-21 12:06pm
View
Could you post a normal answer with the math to do this so i can see if it works and close the topic?
strangerick
25-Aug-21 12:00pm
View
I don't think you get the question, the scrollbar functionalities are working perfectly but when i move the parent of the scrollbar (wich i call viewport) i want the Thumb and Content to keep their Y local positions but i don't know how to calculate their local positions.
strangerick
25-Aug-21 11:38am
View
As you can see from the code i posted the thumb and content and viewport are rectangles and the content is moved up and down by the thumb.
These are all working correctly but when i move the viewport, the thumb and content should keep their local positions but i don't know how to calculate it...
strangerick
25-Aug-21 11:21am
View
Hi, i'm not using Winforms controls nor inheriting from it.
I need the math for the Thumb and Content to calculate thei local positions and keep it when the Viewport is moved.
strangerick
25-Aug-21 6:44am
View
Hi, i posted this question but these problems was already solved, could you help with this new question?
strangerick
25-Aug-21 6:43am
View
Hi, what i need is the math to move the thumb and content so they keep their last Y positions and move to the new position relative to it.
Also, i'm not using the Winform controls, they are all custom.
strangerick
24-Aug-21 14:56pm
View
Ok, that's fine. Maybe later you can provide a answer :)
Also, i'm using only the PictureBox from Winforms, the rest are all custom controls that does not inherit from Control.
strangerick
24-Aug-21 14:41pm
View
Hello, thanks for the answer, but i'm not using Windows Forms controls, they are all custom controls made for a game project.
Could you provide a answer with the math to update the positions of the thumb and content rectangles so they can move to the new Y position relative to their last Y position?
strangerick
24-Aug-21 14:23pm
View
Someone could provide a direct answer with the math to solve this problem?
strangerick
24-Aug-21 14:09pm
View
Deleted
I'm trying to solve this problem since yesterday and tried many many things, that's why I'm here asking for some simple math.
strangerick
24-Aug-21 13:36pm
View
Deleted
What I need is the math for moving the scrollbar controls with the parent control, that's all. Also, I'm not using the WinForms controls or anything related to it as this is for a small game project.
strangerick
17-Aug-21 19:10pm
View
Anyone? I really need some help with this.
strangerick
16-Aug-21 17:45pm
View
Hello, i edited the question and linked to a MSDN article as reference. I hope i made it a bit more clear.
strangerick
16-Aug-21 12:22pm
View
The common Windows Form rectangle: https://docs.microsoft.com/pt-br/dotnet/api/system.drawing.rectangle?view=net-5.0
strangerick
16-Aug-21 11:58am
View
Hello, the language is C# and i'm using Windows Forms.
The content being scrolled are Rectangle structures.
strangerick
16-Aug-21 8:43am
View
Thanks for the commend @RickZeeland, but this does not solve my problem directly as the only thing left for me to do is to calculate the Value, Minimum and Maximum properties as i described them in the original post. Also, as i stated in the other comments, i don't want to use .NET controls in this project
Edit: I already looked in the article you posted and also the link to the custom skinned Scrollbar he linked.
strangerick
16-Aug-21 8:37am
View
I've searched for answers to this problem a lot but could not find anything that solved it so i would be glad if someone could provide a direct answer for them.
Thanks for the comments.
strangerick
16-Aug-21 8:34am
View
@OriginalGriff Thanks for the comment but i'm creating this UI system in my game for practice and i don't want to use the .NET controls in this project.
strangerick
16-Aug-21 8:34am
View
Deleted
@OriginalGriff Thanks for the comment but i'm creating this UI system in my game for practice and i don't want to use the.NET controls in this project.
strangerick
16-Aug-21 8:24am
View
The problem is i don't know how to calculate the Value and Minimum and Maximum properties as i described, i also described their role in this code at the end of the post and i'l test it in the DotNetFiddle when i finish the code.
strangerick
16-Aug-21 8:17am
View
Hello, i do understand some of the code and i posted here for people to help me with the parts i don't understand, also i'm implementing this UI system for practice and i don't want to use the .NET controls.
Could you please help me with this problem?
Show More