Visual C++ :: Direct2D - Auto-resizing Bitmaps

Feb 9, 2013

Apparently the default behavior with Direct2D when rendering is to scale everything I render based on the size of the render target/window. How can I prevent this? I want to decide for myself when to scale the image, regardless of the size of the window.

View 1 Replies


ADVERTISEMENT

Visual C++ :: How To Append Two Bitmaps

Nov 28, 2013

Is there a way to append two bitmaps, one of them in a top of another one ? I mean arrange them like tile horizontally.

View 1 Replies View Related

Visual C++ :: Display Anti-aliased PARGB Bitmaps In A Menu

Dec 2, 2012

I'm attaching a project that demonstrates the issue. I need to display a context menu with anti-aliased bitmaps. I wrote my own method to convert an icon into a bitmap (see the CreatePARGBBitmapFromIcon() method) but the resulting bitmap seems to lose all anti-aliasing when displayed in a menu. What is interesting is that the same bitmap is displayed without any issues in a CStatic 'stPic1' control (the one in the middle.) The visual artifact also seems to be different on different OS. Take a look at the screenshots attached.

View 1 Replies View Related

Visual C++ :: Repaint On CDockablePane Resizing

Jul 13, 2013

I have a tabbed CDockablePane with 3 Panes in total lets say Pane1 is main pain and Pane2 and Pane3 are added to the Main pain with AttachToTabWnd. In each pain I have 1 control but I will also eventually add a toolbar as well. I have created a CListCtrl with each pane. I call Override OnSize to resize the ListCtrl when the pane resizes. Problem is when I resize the width (enlarge) it does not update. If I drag the right border 1 pixel to the left it does update correctly. I have tried invalidating the pane after resize but still does not update as it should. What can I do to remedy this?

View 3 Replies View Related

Visual C++ :: Resizing Controls And Text Content

Sep 11, 2013

I have a SDI application that uses a CFormView class to create a window and this window has 2 buttons and 2 edit boxes.

I can resize this window, like minimize and maximize, but the controls all stay at the same place.

I know that it's possible to move the controls based on window size.

But what i want to do is, as the window is expanded the controls and it's text content to grow proportionally and same when the window is shrinked.

Is that possible to do? i.e., increase/decrease size of controls and texts per window size.

View 2 Replies View Related

C++ :: How To Generate Auto ID (or Auto Number)

Feb 16, 2012

This code is for (hospital management system).

This code allow you to add patients.

There are two types of patients. which is:
1. Normal patient.
2. Critically ill patient.

once you added any patient. You will be able to show all patient using "ShowAllPatient;" method. -> i want the Auto-increment ID Number to appear for each patient has been added.

And you will be able to call a patient to provide a hospital services for him/her using "GetNextPatient;" method.

I need to generate an Auto-increment Number for each (patient) has been added. (Auto-increment Number) but it just should be different for each patient. For example the first patient will have 1, The second patient will have 2. etc. The Auto-increment number should appear for each patient.

View 14 Replies View Related

Visual C++ :: Auto-close MSG Box - Without Button And Title

Apr 1, 2015

I referred Auto-close message box.

But i like to view the message box with out title bar and buttons. Is it possible?

View 4 Replies View Related

Visual C++ :: Auto Start Function After Cdialog Was Shown?

Nov 19, 2013

I want to start a time intensive function after showing a modal cdialog. How can I do this?

Starting the function in OnInitDialog do not work because the dialog is not shown, then.

View 10 Replies View Related

Visual C++ :: Initializing Auto Variables - Cannot Convert Parameter

Sep 8, 2014

I am new to VC++ 2012. I have this code snippet.

Code:
auto it = query_map.find(U("callback"));

The problem is right under the dot there is a red line the error is

Error1error C2664: 'std::_Tree_iterator<_Mytree> std::_Tree<_Traits>::find(const http::uri::encoded_string &)' : cannot convert parameter 1 from 'const wchar_t [9]' to 'const http::uri::encoded_string &'d:maverickprojectsstrikeforcesrcserverserverserver.cpp26

What is the solution to this error?

View 3 Replies View Related

Visual C++ :: Program To Auto Login Website - Waiting With Message Loop

Aug 25, 2013

I am writing a program to auto login in a web site. Before making next attempt I have to wait for some time like some 10 seconds(it is configurable). But during waiting UI should not freeze. I wrote code something like this. Here event m_hEvent[1]) will be set by another thread after 10 seconds.The problem is UI still freezes some times!

while(1)
{
//m_hEvent[1] will be set by another thread after 10 seconds
dwRet = MsgWaitForMultipleObjects(1, &m_hEvent[1], FALSE, dwMilliseconds, QS_ALLINPUT);
ResetEvent(m_hEvent[1]);

[Code] ....

View 4 Replies View Related

C++ :: Detecting Mouse Clicks With Direct2d

Jan 21, 2014

I have a direct2d application and I want to be able to detect mouse clicks. One example is, (in my borderless window) I would like to have an X at the top right of the screen, that when clicked would close the window. How can I do something like this?

View 3 Replies View Related

C++ :: Initializing Direct2D Class - Syntax Error

Mar 16, 2012

I'm using a singelton class ( is this coded correctly?), and from the main class, im trying to initiliaze my Direct2D class, only I do get this error:

error C2143: syntax error : missing ';' before '.'

These lines gives it:

CSingleton.GetCDirect2DInstance()->CreateDeviceIndependentResources();

singleton.hpp

Code:
#ifndef CSingleton_h__
#define CSingleton_h__
#include "CDirect2D.hpp"
class CSingleton {
public:
static CDirect2D* GetCDirect2DInstance();

[Code] ....

View 9 Replies View Related

C++ :: Dynamically resizing Array

Mar 27, 2013

int size = 10;
int* arr = new int[size];

void resize() {
int* resize_arr = new int[size + 1];

[Code] ....

i came across this code to dynamically resize an array...and here in the last statement they have deleted resize_arr.As resize_arr and arr points to samething...i think that memory that arr pointing to is also deleted...i guess correct thing would be delete [] arr....before we assign resize_arr pointer to arr...!! i am new to c++...

View 7 Replies View Related

C++ :: Making Array Bigger - Resizing?

Feb 20, 2013

As part of class project I'm working with the following code...

Item.h

#ifndef ITEMH
#define ITEMH

#include <iostream>
#include <sstream>
#include <string>
#include <iomanip>

[Code] ...

The plan is to add a new method 'resize' where a new array will copy the contents of the first original array and modify the already existing 'add' method to call 'resize' when necessary.

Up till now, in the constructor I created the new array, should I give the array a default value?

View 5 Replies View Related

C++ :: Dynamically Resizing Array While Program Is Running?

Feb 4, 2015

I'm working the 4th problem in chapter 14 of the Jumping into C++ book. In the book, he gives an example program for dynamically resizing an array while the program is running. It works fine for integer types but i need to do the same with a string type array. Right now my program is crashing because the string array is not resizing itself. Here's the part of the code im trying to figure out. The part for the int array has been ignored using // since it works fine and I'm trying to figure out whats wrong with the string array.

Code:
#include <iostream>
#include <string>
//Write a program that lets users keep track of the last time they talked to each of their friends.
//Users should be able to add new friends (as many as they want!) and store the number of days ago

[Code]......

View 8 Replies View Related

C/C++ :: Rectangle Not Resizing Properly - Odd Multiplication Result

May 28, 2014

I'm having some issues understanding why the "rectangle" in the following code isn't resizing properly. Here's the code:

#include <iostream>
using namespace std;
class Rectangle {
public:
Rectangle(double w, double h, double f)
: width(w), height(h), factor(f)

[Code] .....

I tested the code with a simple multiplication factor of "2", which should result in a new width and height of 4, but instead I get an odd value that seems be close to 4.

Output:

Numerically enter the width of the rectangle: 1
Numerically enter the height of the rectangle: 1

The width of the rectangle is: 1
The height of the rectangle is: 1
The area of the rectangle is: 1
The perimeter of the rectangle is: 4

Numerically enter a number to resize the rectangle: 2

The width of the rectangle after resizing is: 2.07408e-317
The height of the rectangle after resizing is: 2.07408e-317

View 2 Replies View Related

C/C++ :: Resizing Matrix And Zero-parameter Class Member

Sep 19, 2014

I'm attempting to make a matrix class, and so far I've made a member that can make a vector of vectors, but I'm not sure how to go about resizing the vectors if need be.

EX: resizeArray(3,3) should return a 3x3 vector.

Also, for some reason when I call my default member, matrix(), I get an error that says.. "Request for member numrows in myMatrix, which is of type matrix<int>[][]"

#include <iostream>
#include <vector>
using namespace std;

[Code].....

View 1 Replies View Related

C/C++ :: Insert Number Of Elements From One Into Another Vector Without Resizing

Dec 28, 2012

I think std::copy appears to do what I'm looking for.

I'm in need of a vector member function that would allow me to "insert" a number of elements from one vector into another vector without resizing or destroying either.

An example of what I'm wanting to do is assign the contents of two[3-5][50-54] to one[7-9][2-6]. Other than looping through both vectors using .at(), is there a way to copy this?

This would be continuous within a user controlled loop with differing elements being exchanged.

typedef vector<vector<unsigned char> > vec;  
vec one(10, vector<unsigned char>(10, '1')),
    two(90, vector<unsigned char>(90, '2'));  

View 4 Replies View Related

C# :: Resizing Panel Controls On A Maximized Form (VS2008)

Mar 1, 2014

I made one application in Visual Studio 2008. The main form is maximized, and contains many panels with different controls (like buttons, listboxes, etc,). All the controls have the dock option fixed as true in panels, and the panels occupied the whole area of form.

Now, when I try to run this application in a machine, with different resolution of the screen, the form is maximized (naturally), but the panels are not resizing, so the form has many null area. How can I resize the panel so, that they fill the whole form area?

View 4 Replies View Related

C++ :: Resizing Widget - Change Size Of MainWindow During Runtime

Aug 31, 2012

I have QTextEdit in mainWindow. I'm trying to resize QTextEdit so height = mainwindow.height and width = height/2. That should change when I change the size of mainWindow during runtime. How can I do that?

View 2 Replies View Related

C++ :: Auto Align CPP File

Apr 20, 2014

Is there a way to auto align a cpp file?

View 7 Replies View Related

C# :: Use Of Auto-implemented Properties?

Jan 28, 2014

Code using auto-implemented property:

public class MyClass {
public int age { get; set; }
}
static void Main(string[] args) {
MyClass testing = new MyClass();
testing.age = 44;
Console.WriteLine(testing.age);
}

output: 44

Code using regular variable declaration:

public class MyClass {
public int age;
}
static void Main(string[] args) {
MyClass testing = new MyClass();
testing.age = 44;
Console.WriteLine(testing.age);
}

output: 44

Why use the auto-implemented property when you can just as equally use the second code block to achieve the same thing?

View 14 Replies View Related

C/C++ :: Using Auto To Declare A Pointer?

Apr 24, 2014

I write these code in 2 different ways and I get the same result. I just want to make sure that they both are for declare a pointer using "auto"

The first one:

int varName = 10;
auto var1 = &varName;
cout << var1 << endl; //prints, varName address
cout << *var1 << endl; //prints, varName value

The second one:

int varName = 10;
auto *var2 = &varName;
cout << var2 << endl; //prints, varName address
cout << *var2 << endl; //prints, varName value

It doesn't matter if I put dereference operator or not, I still get the same result. I just want to make sure that var1 and var2 are both a pointer.

View 5 Replies View Related

C/C++ :: Difference Between Auto And Decltype In 0x

Jun 7, 2012

I'm having trouble with auto and decltype.

 void f(const vector<int>& a, vector<float>& b) {
        typedef decltype(a[0]*b[0]) Tmp;
        for (int i=0; i < b.size(); ++i) {
          auto p0 = new auto(a[i]*b[i]);
          auto p1 = new decltype(a[i]*b[i]);

[Code] ....  

The above code runs well in GCC4.7.

Could I use 'new auto(a[0]*b[0])' to allocate memory for the type of a[0]*b[0]?

And I can not distinguish the difference between decltype and auto in this case.

View 1 Replies View Related

C++ :: Does Not Have Auto Completion For Curly Braces

Jan 6, 2013

I presently use the turbo C++ IDE. it has the red background(changeable) and all that but it does not have auto completion for curly braces.

View 19 Replies View Related

C++ :: How To Create Auto Clicker Typer

May 31, 2013

Okay so what I want to do is :- Create a program that can, say for example, switch to an already opened up google search page. Type in a given string and press enter.

Once more. The google search page is open.[Type anything on google.com and then THAT next page is the one ..] **So , the search box ,where you enter text has fixed coordinates.. (Which website doesnt matter, only coordinates do!)

I want the mouse to go to those coordinates, *click* and now a cursor will appear on the search box.

After this I want to send a fixed string output...That is , it should actually type in the string in that search box. then press enter.

That's it . [P.S. - obviously I don't want to do this with google, that was just an example.]

Mini Algorithm-

1)Get the mouse pointer to the x-y coords
2)Click!
3)Type in the fixed string.
4)Enter..

I can put it in a loop, don't bother with the easy bits I need to know how to control the mouse, and how to send the input string. Code snippets would be perfect

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved