resize

QGraphicsItem interactive resizing

こ雲淡風輕ζ 提交于 2020-01-16 00:46:38
问题 i've forked the project https://github.com/cesarbs/sizegripitem that is a intercative QGraphicsItem resizing with 8 handlers, the problem is that if i set my main QGraphicsItem to be Selectable, when i drag the handlers, the main QGraphicsItem moves rather then being resized, bellow is the source for SizeGripItem.cpp /* * SizeGripItem - A size grip QGraphicsItem for interactive resizing. * * Copyright (c) 2011 Cesar L. B. Silveira * * Permission is hereby granted, free of charge, to any

Php resize width fix

只谈情不闲聊 提交于 2020-01-15 12:29:09
问题 I have this function in PHP. <?php function zmensi_obrazok($max_dimension, $image_max_width, $image_max_height, $dir, $obrazok, $obrazok_tmp, $obrazok_size, $filename){ $postvars = array( "image" => $obrazok, "image_tmp" => $obrazok_tmp, "image_size" => $obrazok_size, "image_max_width" => $image_max_width, "image_max_height" => $image_max_height ); // Array of valid extensions. $valid_exts = array("jpg","jpeg","gif","png"); // Select the extension from the file. $ext = end(explode("."

Maintain a controls Aspect Ratio on Resize

荒凉一梦 提交于 2020-01-15 12:13:02
问题 I have a panel control with a picture box in it. How can I maintain the aspect ratio of the panel control when Resizing the form it's on? 回答1: You'll need to store off the aspect ratio somehow, whether it's something known to you at design time or if you just want to calculate it in the constructor of the form after InitializeComponent() . In your form's Resize event, you'll just need to set the size of the Panel to be the largest rectangle at that aspect ratio that fits within the

HTML/CSS: Create a div that always fills the entire page… and then a resizeable div within it?

最后都变了- 提交于 2020-01-15 10:35:12
问题 I feel like this is an easy question, but for whatever reason I can't figure it out today. I need a div that always fills the entire page, no matter how large that page is. Then I need another div which I can re-size with javascript (mydiv.style.width = x; mydiv.style.height = y;). If the second div is resized to be taller than the existing browser window height, the first div should resize to fit. i.e. If the first div's background color is red, I should never see any white background color,

Programatically Created Label Within Container View Won't Expand For Text

微笑、不失礼 提交于 2020-01-15 09:29:48
问题 I have a reusable view class, with the function .addDisapearingView() when added to another view displays the text in the functions parameters. Both the label and its container view are programmatically created. When there's long text in the label, I want the label, and the view to both grow in height. When there's text too long for the label, the label doesn't grow-and the text, subsequently, doesn't clip/go to next line. I'm trying to get the container view to expand programmatically based

Drawing in window while resizing leaves Unpainted border

守給你的承諾、 提交于 2020-01-15 07:47:13
问题 The problem that I have seems to be trivial, but I cannot find a way to solve it. Here it is. I have a window with some graphics in it. For simplicity lets say it's a solid green rectangle which fills the entire client area of the window. I want this rectangle to be redrawn and to fill the entire window every time the window changes its size. What I did originally was this. I posted WM_PAINT message from WM_SIZE handler. It works, but if I move mouse fast I see a bit of unpainted (white) area

Resize image in Java without losing transparency

僤鯓⒐⒋嵵緔 提交于 2020-01-14 16:47:12
问题 I want to resize an image (jpg, png, gif) without losing the transparency. I want to save the resized version to the disk after resizing. I googled a lot but I only found solutions that lose the transparency and fill the transparent space black... I am looking for a snippet or a library that does the job :) 回答1: This is how i solved my problem: public static BufferedImage convertRGBAToIndexed(BufferedImage src) { BufferedImage dest = new BufferedImage(src.getWidth(), src.getHeight(),

Scale HTML content using JQuery Mobile & Phonegap

拟墨画扇 提交于 2020-01-14 14:16:10
问题 I need to dynamically load content from HTML emails into some type of content area within my HTML so that it is scaled to fit, exactly the way the native mail apps do for iPhone/Android. I have spent two days Googling and testing to no avail. I'm loading the HTML content (which is often set to width=600 or something nice), but rather than scaling, it is appearing as follows: iPhone Simulator Example The HTML is very simple: <div data-role="page" id="messagedetailpage" data-add-back-btn="true"

Scale HTML content using JQuery Mobile & Phonegap

一曲冷凌霜 提交于 2020-01-14 14:15:51
问题 I need to dynamically load content from HTML emails into some type of content area within my HTML so that it is scaled to fit, exactly the way the native mail apps do for iPhone/Android. I have spent two days Googling and testing to no avail. I'm loading the HTML content (which is often set to width=600 or something nice), but rather than scaling, it is appearing as follows: iPhone Simulator Example The HTML is very simple: <div data-role="page" id="messagedetailpage" data-add-back-btn="true"

In c++ Windows API resize window during runtime?

假装没事ソ 提交于 2020-01-14 13:05:56
问题 How do you resize a global hwnd variable during runtime when a button is clicked? Or just any way to resize the window during runtime. i.e. HWND hwnd; //global int buttonid = 250; // an id for a button //also global int WINAPI wWinMain(/*blah blah blah */) { //blah blah blah hwnd = CreateWindowEx( 0, L"WindowClass", L"Window", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 300, 275, NULL, NULL, hInstance, NULL ); HWND mybutton = CreateWindow( L"BUTTON", L"Button", WS_VISIBLE | WS_CHILD |