Is it possible to change brush size options in Aviary Image Editor (Web SDK)? - adobecreativesdk

I'm implementing the Image Editor in a web project, and can't find in the documentation how to change the brush sizes available in the UI (for the Draw tool).
For our application, even the smallest brush size from the default set is way too big for the drawing operation being performed.

Related

VSTO Outlook: Setting custom task pane height based on the screen resolution

I have an VSTO Outlook Add-in which shows a custom task pane (ctp). This ctp embeds a usercontrol which in turn contains an elementhost. The elementhost hosts an WPF user control.
At Add-in startup I create the ctp and I set it a fixed height, e.g. 120 points. I have noticed that depending on the screen resolution the ctp height gets smaller or bigger.
So I would like to know if there is a way to set the ctp height according to the current screen resolution so it does not get smaller or bigger.
For example some formula:
ctp.Height = Default_Height * Y_Scaling_Factor
I have tried setting the autoscalemode to font and dpi and it does not work.
You need to set the AutoScaleMode property to None if you don't want to get the container scaled according to the screen resolution.
The AutoScaleMode property specifies the current automatic scaling mode of this control. Scaling by Font is useful if you want to have a control or form stretch or shrink according to the size of the fonts in the operating system, and should be used when the absolute size of the control or form does not matter. Scaling by Dpi is useful when you want to size a control or form relative to the screen. For example, you may want to use dots per inch (DPI) scaling on a control displaying a chart or other graphic so that it always occupies a certain percentage of the screen.
For more information about automatic scaling, see Automatic Scaling in Windows Forms.
Also you may take a look at the AutoSize and AutoSizeMode properties that resize the form according to the setting of AutoSizeMode.

VSTO Outlook: Custom Task Pane height

Why the custom task pane height is set in points?
What do points mean? If I want to set the custom pane height to work with all the display resolutions, how do I need to set this? using some kind of formula? For example I set as below in a screen resolution of 3024x1890 and it is shown correctly:
ctp.Height = 160;
However when I visualize it in a screen resolution of 1920x1080 the custom task pane is not shown correctly, I mean, height is bigger that the one in 3024x1890.
Pixels and points are static measurements - they don't change based on other factors: 1 pixel is always 1 pixel and is the smallest piece of a screen that can display colors. 1 point is always 1 point and is an abstract unit, only having meaning when referenced in relation to other points.
You need to set up the AutoScaleMode of the UserForm to the Dpi which specifies the different types of automatic scaling modes supported by Windows Forms. Then you can try to use dock and anchor properties to auto resize and adjust controls. That may work only for standalone applications and not in Outlook (depends on Outlook version). So, additionally you need to detect the DPI level and set up the UI accordingly.
Take a look at the following pages for more information about scaling in Windows:
Windows Forms DPI scaling
Creating a DPI-Aware Application
Automatic scaling in Windows Forms

how to make a bitmap to fit to the static picture control of a property sheet?

I am having a property sheet and added three pages.In the first page I added a picture control and in the properties of that picture control for "Image" property I am setting a bitmap.And was able to load very successfully.But,the problem here I faced when I run my exe then I am getting bitmap on the page header(which is some kind of banner for the page.)But what I noticed is there is some gap between the banner bitmap and the frame edge (which is occurring at the right top corner). And when I ran my xxx.exe on a Japanese machine then I had observed like the sheet is somewhat stretched and banner bitmap is not stretched completely till the edge of the sheet (top right corner)for Instance if we take a dialog on load a bitmap on it then we can observe that it is entirely got stretched till the edge.
So how can we avoid this issue like whatever the operating system it is and whatever the resolution it might be that banner should get stretched till the edge of the sheet.The gap has to be removed.
I am not loading the bitmap dynamically (setting in the properties.)
Can anyone please help me ti achieve this
The reason you get different results on different systems is that dialogs and controls are sized using "dialog units" which are based on the average size of the font, rather than an absolute number of pixels.
By default a static image control will resize itself to the size of the bitmap it's displaying. So if the dialog itself ends up bigger than normal (because the font is physically bigger), the picture control will appear to have shrunk, leaving a gap.
You could try setting the SS_REALSIZECONTROL style on the static control. The normal behavior of the static control (when displaying a picture) is to resize itself to the size of the bitmap, however the SS_REALSIZECONTROL style overrides that behavior and instead causes the bitmap to be resized to the size of the control. However the results of that may be less than optimal (e.g. the aspect ratio will probably be wrong), so instead you may want to look into scaling the bitmap yourself.

How do I set a custom button background for a Metro app for all states

I want to use my own bitmaps for my buttons for a Metro style Windows 8 app. I can set the background brush for a button to my own ImageBrush and that works fine, except for the hover and pressed states. I cannot figure out how to set the bitmaps for them. Does anyone know how to do this?
Thanks.
WinRT XAML Toolkit has an ImageButton control that allows to define images for all states if that is what you need. You can also check its default template in Generic.xaml to see how it uses the bitmaps based on multiple overlaid Image controls (check e.g. PART_HoverStateImage) and visual states that control opacities of these Image controls.
If you are lazy - you can also use just two bitmaps and use semi-transparent bitmap defined using the PressedStateImageSource overlaid on top of the bitmap defined with IdleStateImageSource to show a hover state. Or you can go fully lazy and use just a single bitmap for idle state and let the control generate bitmaps for the other two states by setting GeneratePressedState and GenerateHoverState to true - that generates these bitmaps by "lightening" the idle state image with some basic image processing. The Toolkit also has a sample app with a page that demonstrates the use of the ImageButton control in multiple ways.

Aligning text boxes

I'm have some data output text boxes (text boxes with no border and with the same background as the rest of the window) that I'm trying to align with a standard edit control + spin button, to represent a column of numbers, one of which can be edited:
I can manually align these in the Delphi / C++Builder form designer, but when I then view the form on a different version of Windows or at a different DPI, the text is no longer right-justified, presumably because of differences in the spin button spacing, borders, etc.
I can use EM_GETMARGINS to determine the width of the spin button, but how can I determine the size of the edit control's margins and borders? I've tried various combinations of EM_POSFROMCHAR, ClientToScreen, GetSystemMetrics(SM_CXBORDER), GetSystemMetrics(SM_CXEDGE), and GetThemeMargins, but so far, I can't find a combination that works and makes sense.
More details:
Environment is Delphi / C++Builder XE2.
The data output controls are TEdits with BorderStyle bsNone.
The edit + spin button is a TJvSpinEdit. From viewing its source, it uses EM_SETMARGINS to allow space for its spin button.
Use the Win32 API GetWindowRect() and GetClientRect() methods. The bordering will be the difference between the two rectangles. That will only give you the bordering, though. There could be extra spacing inside the client area.

Resources