once agian i need help from all the kind users.
Im using Interop.GEPlugin to develop an application to display certain points on the google earth globe, with different color circels. So far all of that is working, but the problem is the size of this placemark. i want i bigger, like alot!
The code to setting up the placemark is:
KmlIconCoClass icon1 = m_ge.createIcon("low");
icon1.setHref("http://www.wispresort.com/images/easier.jpg");
icon1.setW(3000);
icon1.setH(3000);
var style = m_ge.createStyle("");
style.getIconStyle().setIcon(icon1);
For some reason, when i only add either icon1.setH(3000) its getting higher, but when i add both it just goes back to the original size.. Did i misunderstand something? or is this just a simple mistake in the plug-in??
Hope you can help me, Thanks.
The GE plugin behaves strangley with icon sizes. Even if you provide a large image as an icon, GE attempts to scale that icon down to a default size around 32 pixels. The most effective way I have found to change the size of an icon is with the setScale() method of the kmlIconStyle. The scale is simply a multiplier. If you want a 32px default icon size to bee 3000 pixels, then you can set the scale to about 94 (32x94=3008). kmlIconScale.setScale(94);
KmlIconCoClass icon1 = m_ge.createIcon("low");
icon1.setHref("http://www.wispresort.com/images/easier.jpg");
var style = m_ge.createStyle("");
var iconStyle = style.getIconStyle();
iconStyle.setIcon(icon1);
iconStyle.setScale(98);
The other issue you will face is that GE will automatically scale icons to shrink as you zoom out, so there is so way I have found to make an icon stay at a set size at all scales
Documentation for kmlIconStyle.setScale
Related
Recently I thought: "Let's set the 'resolution' from 16:9 to 16:9(1920x1080)" but i noticed that now all my positioning* code was off, and the size of pictures and text was way too small.
My problem now is, if I should just use the 16:9 aspect ratio or an fixed resolution (I don't know the benefits). But if I shouldn't use the aspect ratio, how to change the fixed resolution when the Project is ready, for example in the settings, without needing to rewrite all my code* and rescale all my images on the Canvas according to the resolution.
*For those of you who don't know what I mean with 'positioning', I mean setting the position of an Image on the Canvas, which obviously needs to be changed because the resolution is different. You could make something that detects your resolution and positions you image based on that, but idk if there is a better solution.
The best way to do this is during positioning ui using procentage also canvas Type which is displayed to resolution.
https://youtu.be/Tys6QWi9RpM
Solution on yt.
I am trying to set up a shopping based UI for different screen sizes.In the canvas settings inside the Inspector I have given a reference resolution of 750 x 1334(Iphone 6)
UI scale mode - Scale with screen size
Match(Width-Height) - 0.5 (Which I change to one can see them in the images)
Somehow I placed the Images and text according to given design.It looks ok in the Iphone resolution.But in Ipad the buttons and text gets mixed up.
Now I change the Match(Width-Height) - 1 .The result is it looks okay but in the ipad view it looks small and there is plenty of space along the two sides.
How to get a matching view/look for all the different screen sizes.
Images are given below
Actually, u don't need to change the match size.
what u actually have to use are anchors. If u use anchors no matter how the size of the screen changes the UI element will resize with it.
see this video from unity officials. It will definitely solve ur issue.
https://www.youtube.com/watch?v=FeheZqu85WI&list=PLX2vGYjWbI0Qp0sD8_RKgbWul7z_eyNAv&index=2
thank you.
U can accept this answer if this solves ur issue.
Just recently I switched my Windows to 125% DPI scaling mode and found out that my app does things that I don't want it to do.
One of the problems is scaling of the image I am showing in the app. Let's assume it can be any image and for this example let it be a 600-pixel wide one. I want it to stay just like that. I'm ok with scaling the rest of the interface but this one particular Image control has to be exactly as wide as the Image is, and not scaled up to 125% (to 750 pixels). How can I achieve that? Should I change control size after some DPI-related event fires?
Also, the second question is, why WPF is lying to me? When I get ActualWidth it tells me 600 pixels, but Paintbrush isn't lying - I hope - and it shows 750 pixels when I measure width on the screenshot. Should I be checking this value after any particular event so that I get an actual ActualWidth?
Some code:
imgNav.Source = ImageManager.LoadBitmapImage(uri);
BitmapImage bimp = imgNav.Source;
imgNav.Height = bimp.PixelHeight;
imgNav.Width = bimp.PixelWidth;
...
txtFoo.Text = imgNav.ActualWidth.ToString();
Thank you in advance for any suggestions.
I have an application that scan Images from scanner but some scanners put a black border around the saved image.
How can I remove that black border?
Thanks so much for your participation.
I’ve had good luck in the past process images using the Magick.NET library. It’s available on Codeplex or you can install it using NuGet in Visual Studio. Documentation for the library is a little sparse, but it’s served me well in the past.
Depending upon the exact nature of the images you’re dealing with, you might be able to do something as simple as crop off the edges where the border is and then add a white (or whatever color; I just assumed that you were scanning text documents or something) border to bring the image back up to a standardized size. If having a standardized size doesn’t matter, then of course you can just leave the image cropped. If that sounds like a viable solution, here’s some code that should accomplish what you need:
using (MagickImage image = new MagickImage(#"path_to_original"))
{
int width = image.Width, height = image.Height;
image.Crop(width - 800, height - 800);
//if the image needs to be brought back up to a standarized size
image.BorderColor = new ColorRGB(System.Drawing.Color.White);
image.Border(100, 100);
image.Write(#"path_to_cropped_image_with_no_more_black_border_around_it");
}
You will, of course need to add your own values for just how much width you need to crop off/add back in.
I am using axWindowsMediaPlayer and when I make the screen full, video is being shown but the player put 2 black block near side of video. I don't want these blocks.
I tried
axWindowsMediaPlayer1.stretchToFit = true;
but that didn't work. Because my video is 800*600 and my screen 1920*1080, the problem might be. Any way to solve this problem programatically? I don't want to resize video.
Thanks in advance.
AxWMPlayer does not support nonuniform stretching. So, you have to either:
- make the WMPlayer of normal desired size, stretch uniformly (StretchToFit=true) and live with the black margins if they show up
- make the WMPlayer oversized in Height or Width (so that it sticks out of the target space), stretch uniformly (StretchToFit=true). Due to the oversized WMPlayer, some of the video will be trucated (displayed outside of the space) but also the black margins will be truncated
Those two ways will mantain aspect ratio.
If you don't need aspect ratio kept, you may apply some ScalingTransform (WPF) or another similar effect to stretch the view afterwards. You will need to calculate coordinates properly, but the fact that WMP always centers the video and that you can read the video dimensions from IWMPMedia helps much.