473,387 Members | 1,592 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Can I draw witohut knowing what the size would end up being?

I've got a problem where I need to create an image so I can draw to some
"offline" graphics object and in order to create that image I need to specify
size but I will not know size until I'm done drawing...

Is there any way I can just draw to something that doesn't have a size and
then crate a cropped image out fo that?
Nov 1 '06 #1
1 1172
Hi,

I see three choices:

1. Create the drawing surface (image) so that it's as big as the biggest
drawing that you will ever expect
2. Calculate the size of the drawing first
3. Create an initial buffer of the average image size in your application.
If you need to draw oustide the boundaries of the image, create a new
drawing buffer sized to some acceptable factor (like [·2,]), and then
copy the current buffer to the new surface - dispose of the initial buffer

--
Dave Sexton

"MrNobody" <Mr******@discussions.microsoft.comwrote in message
news:4C**********************************@microsof t.com...
I've got a problem where I need to create an image so I can draw to some
"offline" graphics object and in order to create that image I need to
specify
size but I will not know size until I'm done drawing...

Is there any way I can just draw to something that doesn't have a size and
then crate a cropped image out fo that?

Nov 1 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Mathieu Chavoutier | last post by:
I want to draw images. So, I do : myPanel.Invalidate(new Rectangle(state.getEndX(), state.getEndY(), state.getSize(), state.getSize())); Then : public override void repaint(object sender,...
3
by: Richard | last post by:
I have a requirement to put a GDI style circle or rectangle border around the selected row of a datagrid/ It will overlap into the row above and below the selected row. Doing this in a the OnPaint...
9
by: Duncan Barnes-Ceeney | last post by:
I’m having problems with a custom Combo box. The main problem is that I want to modify the look of the combo which includes the size of the button. To do this I have inherited from the standard...
26
by: alberto | last post by:
Hi. Im newbie in C language. I have a binary file with many character arrays of 50 character defined as char array But in some cases, many of these 50 characters are not being used. I would...
1
by: zxo102 | last post by:
Hi everyone, I have tried two days to figure out how to draw the image in wx.BufferedDC on the page created by AddPage of wx.Notebook but still got no clue. The attached example works fine. If...
3
by: Daniel Mark | last post by:
Hello all: I am looking the sample code posted on PIL website http://www.pythonware.com/library/pil/handbook/imagedraw.htm ################################################ <<Draw a Grey Cross...
1
by: Jeff Waskiewicz | last post by:
Hello All, I'm trying to solve a nagging problem. The goal is to draw a rectangle over the top of all the other controls on a form. Specifically, over a ChartFX control. The user would draw...
11
by: Kevin Williamson | last post by:
Hi, I've written a lottery programme in PHP that selects 10 winners a week from approximately 18,000 shares. The problem I have is that of the ten winners one week the same share number was...
12
by: active | last post by:
I've been looking on the Internet for a way to convert a DIB to a Bitmap without success. Now I'm wondering if that is the approach I should be taking. All I want to do is display the DIB or...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.