简体   繁体   中英

rescale region to fit resolution C#

Here's the problem I'm facing; I'm trying to create a smaller 'window' inside my application but let's say the size of the 'window' is roughly 980x550 and it needs to be rescaled to 880x720. Would I have to create an extra instance and add/remove the distance from the geometry of where I place a dot or is there a quick cut method that can rescale a bitmap?

edit: ** I should say that what needs to be scaled is a rect, not the image it's self. So a dot gets drawn and scaled. Relative to the smaller picture **

edit 2:

For anyone that comes across this thread, what I ended up doing was using percentages instead of actual positions, that way the position is relative no matter what :)

Looks like a duplicate of Resize an Image C# which has some excellent answers to your "...is there a quick cut method that can rescale a bitmap?" question, although it depends on whether you want to interact with the scaled image (your "where I place a dot" question suggests editing).

对于遇到此线程的任何人,我最终要做的是使用百分比而不是实际头寸,这样无论如何头寸都是相对的。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM