How to change the size of layer with all elements in PHOTOSHOP? - height

I need the sizes of layer like width - 7sm, height - 10sm. Also all elements scaled correctly by size of layer the same time. Is it possible?
Image

To change the size of a project. Go to the image tab and select image size. To scale multiple layers at once. Click one and hold shift, then click another.

Related

How do i increase the size of my tooltip in c++/cli?

I want to increase the size of my tooltip as i want to insert an image as background to my tooltip. I am able to apply an image to my tooltip but the problem is the size of the tooltip being small only the upper part of the image is being displayed.
I am displaying image using Graphics Draw Image function. And I want the tooltip to take original size of an image without creating a rectangle as I tried all already.
I don't want to create my own tooltip. Just increase size of existing one.
I resolved it!! Just needed to add spaces on the property Tool tip on mytooltip on that control on which tool tip is used.Here i have used tool tip on my buttons.

SHGetImageList returns an icon that is too small for the size

I'm trying to retrieve file icons on Windows. I follow this guide http://pogopixels.com/blog/getting-the-48x48-or-256x256-icon-of-a-file-on-windows/
I use SHIL_JUMBO to get the maximum size possible. However, not all icons returned are big enough, such as the QuickTime icon in the attached image. The size of the whole pixmap returned is still 256x256 but it does not fill the entire space. My program will then scale it down, making it too tiny to see.
I'm wondering if I can retrieve some extra info such as the size of the original icon, so I know that it's too small to scale down.

DirectWrite align text center

I am trying to align center the text I have to draw. I use ID2D1RenderTarget::DrawTextLayout method. The problemn is that if I set the text horizontal alignment to DWRITE_TEXT_ALIGNMENT_LEADING (the default value) the text is drawn proberly, but if I change this value to DWRITE_TEXT_ALIGNMENT_CENTER the text is shifted right.
The example string is
Internal Amazing
Scupper
Following are the outcomes (the first is alignment leading):
My comment as an answer (yeah, guessed right :)):
Just a quick guess: Did you check that the maxwidth your layout box
isn't too broad, so the center would end there at the right?
The IDWriteTextLayout used by ID2D1RenderTarget::DrawTextLayout method defines a maximum width of the layout box, which determines where the text is centered. It can be manipulated by the methods of the interface (GetMaxWidth and SetMaxWidth).
When you create the text layout, you cannot change the width and height to something greater afterwards. You should use max screen coords when creating the layout then change the max width and height to the desired size. You should use render_tgt->DrawText(...) method for this example or release and recreate the layout interface every time the text, font name, and a lot of other various things like typography are changed. I created an array of layout and typography events that can be reapplied to the layout interface every time it is recreated. You do not need to recreate the layout for font size, since you can resize the text or individual characters with the layout interface
// Set the layout to maximum screen size
FLOAT maxX = (FLOAT)GetSystemMetrics(SM_CXFULLSCREEN); // * XD2D::pix_to_dips.x;
FLOAT maxY = (FLOAT)GetSystemMetrics(SM_CYFULLSCREEN); // * XD2D::pix_to_dips.y;
XS_DWRITE_DEV_FACTORY->CreateTextLayout
(
dstring,
dlength,
(*pp_txt_format),
maxX,
maxY,
pp_txt_layout
);
// Resize to the requested size or minimum allowed size
(*pp_txt_layout)->SetMaxWidth(max(req_xsize, (*pp_txt_layout)->GetFontSize()));
(*pp_txt_layout)->SetMaxHeight(max(req_ysize, (*pp_txt_layout)->GetFontSize()));

In resources of a executable file, how does one find the default icon?

i need to find the default icon of a windows executable (PE file = dll, exe, com..) programatically. I do know how to walk throught the resources and identify what is an icon, what a cursor etc, but as far as i know none of the icons is in any way marked as the default one. So, does somebody know, how to find the default icon? Moreover, i do not want to use any windows api call, i want to code the function myself. The problem is that i don't know which one of all the icons is the default one.
After a lot of searching, i found out that the default icon is not the one with the lowest id.
Windows use several sizes of one icon for various things. For more information, look here, but in short here is the important information:
When the system displays an icon, it must extract the appropriate icon image from the .exe or .dll file. The system uses the following steps to select the icon image:
Select the RT_GROUP_ICON resource.
If more than one such resource
exists, the system uses the first
resource listed in the resource
script.
Select the appropriate RT_ICON image
from the RT_GROUP_ICON resource. If
more than one image exists, the
system uses the following criteria
to choose an image:
The image closest in size to the
requested size is chosen.
If two or more images of that size
are present, the one that matches the
color depth of the display is chosen.
If no images exactly match the color
depth of the display, the image with
the greatest color depth that does
not exceed the color depth of the
display is chosen. If all exceed the
color depth, the one with the lowest
color depth is chosen.
Note: The system treats all color depths of 8 or more bpp as equal. Therefore, there is no advantage of including a 16x16 256-color image and a 16x16 16-color image in the same resource — the system will simply choose the first one it encounters. When the display is in 8-bpp mode, the system will choose a 16-color icon over a 256-color icon, and will display all icons using the system default palette.
Since the requested size is 16x16 (because thats the system small icon size, ie. the default icon size) i think we can say that the default icon is the icon from the first icon group which has the smallest size (no smaller icon than 16x16 can exist) with the highest color depth.
EDIT: a small correction. A icon of size smaller than 16x16 might apparently be in the resources, but that indicates that the file does not have a default icon and the system then does supply its own icon instead.
The first one you find is the default one.
The default icon is simply the icon with the lowest id, so, by definition, is the first icon discovered when enumerating resources.

How can you make buttons on a MSVS C++ CToolBar larger along with their images?

We have a touch screen, and the toolbar is too small to hit with my meaty fingers. Is there an easy way I can have an option to make the toolbar buttons bigger and easier to hit?
So far I've attempted a few things:
m_toolbar.SetSizes( CSize(64,64), CSize(50,50) );
m_toolbar.SetSizes( CSize(64,64), CSize(50,50) );
m_toolbar.GetToolBarCtrl().SetButtonWidth( 64, 64 );
m_toolbar.GetToolBarCtrl().SetButtonSize( CSize(64, 64) );
None of these approaches stretches the images as well. The buttons get larger, and are fully functional, but the images do not overlap the buttons the way they normally would. I would prefer to keep a single image list for the icons, and have the images stretched to fit.
At toolbar creation time, create an empty CImageList with size 64x64 (let's call it large). Load the original image list from resources (we call it small).
Iterate over each image in small and copy/resize it to large.
Then assign large to your toolbar. Somewhat cumbersome bui should work.
HTH,
As far as I know there is no way to make images resize with the size of the buttons. MFC applications use bmp and not vectorial images.
So you will have to supply a bmp images with the disired sizes.
You can use a CImageList and SetImageList to set the images but then you will have to
initialize images there with the disired size also.