473,406 Members | 2,345 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,406 software developers and data experts.

"drawing" on an image...

My app has an image (black/white tiff) displayed in a picturebox
(scanned text document). I need the user to be able to draw either
white or black rectangles on it. (to hide/cover up sensitive
information, like credit card numbers).

I can do this by loading the file into a graphics object, and then
using the graphics object's methods to do the drawing. The modified
file is then re-displayed on the screen. (by the way, I am using the
MouseDown and MouseUp events to calculate where and how large the
rectangle needs to be)

It works, but there is a few second delay while .NET does all the
processing. Is there a way to do the drawing (click & drag rectangle)
and get INSTANT results? It's frustrating to click and drag the
rectangle, and then wait 5 or so seconds for the rectangle to appear.

This must be possible, because even the most basic graphics
applications allow simple click/drag operations to add shapes to an
image and have INSTANT feedback.

Can anyone shed some light on this?

Thanks!
John

Nov 21 '05 #1
2 1488
Hummmm, what are you doing exactly in the 5 seconds it takes? Also, what
resolution is the image? Does it need to be this resolution? Is it just for
display or are you wanting to save it out again? Why not store two images:
the high resolution version and a lower resolution version - you can blit to
the lower resolution version in real-time, so the user can see, while the
rectangle is moving. When the mouse is released and the drag has stopped,
then you blit the high resolution image according to the coordinates of the
rectangle, and possibly show progress with a thread.....


"johnb41" <or****@informatik.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
My app has an image (black/white tiff) displayed in a picturebox
(scanned text document). I need the user to be able to draw either
white or black rectangles on it. (to hide/cover up sensitive
information, like credit card numbers).

I can do this by loading the file into a graphics object, and then
using the graphics object's methods to do the drawing. The modified
file is then re-displayed on the screen. (by the way, I am using the
MouseDown and MouseUp events to calculate where and how large the
rectangle needs to be)

It works, but there is a few second delay while .NET does all the
processing. Is there a way to do the drawing (click & drag rectangle)
and get INSTANT results? It's frustrating to click and drag the
rectangle, and then wait 5 or so seconds for the rectangle to appear.

This must be possible, because even the most basic graphics
applications allow simple click/drag operations to add shapes to an
image and have INSTANT feedback.

Can anyone shed some light on this?

Thanks!
John

Nov 21 '05 #2
Robin,

In the 5 seconds, i usually get the time to get a snack, and check my
email. :) At least i'm productive during these 5 seconds!

But seriously, the res of a typical image is 2550x3300. That's a
letter size scan at 300ppi. What takes so long is that .net puts this
image into a graphics object. The graphics object does the drawing.
The results get put back into an image object that gets drawn inside a
picturebox. Even the fastest pc will have some delay when this is
done.

The image MUST be re-saved with the changes. That takes processor time
also. But I don't need to "save" the image until all drawing is
complete. So the process would be: Open image and display it --> draw
1 or more rectangles on image without saving it yet --> when done, do
File | Save command.

As I have it now, to show that i have rectangles on the image, i have
to save it and then re-display it. That's probably a large chunk of
the 5 seconds.

Now that you should have a better idea of what i'm trying to
accomplish, lets discuss your solution. Do you still think that "blit"
is a good solution? If so, what's a blit?

Thanks,
John

Nov 21 '05 #3

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

Similar topics

3
by: asognoth | last post by:
Hi... Does anybody have a clue how to solve this problem? the task is to change the following method in that manner that it draws the (calculated) image form left to right instead of from top...
7
by: Dica | last post by:
i've used the sample code from msdn to create an encyption/decryption assembly as found here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetHT10.asp i'm...
0
by: monfu | last post by:
Dear all I have the following code:- System.Drawing.Image src_image = System.Drawing.Image.FromStream(imgStream); Bitmap bitmap = new Bitmap(image_width, image_height,...
6
by: Patrick Dugan | last post by:
Hello, I'm trying to load different images (icons) into a PictureBox1.Image. The first image loads just fine, but the second image always returns the error "Invalid property used." It doesn't...
6
by: Jerry Spence1 | last post by:
I'm going mad here. I know about creating controls at runtime and creating a single event etc. In all the examples I have found they create a button and create an event for it. What I can't fathom...
4
by: Greg | last post by:
I've searched everywhere for a solution Microsoft .NET Framework V 2.0.50727 AutoEventWireup="false" image2.aspx resize an image on the fly but Page_Load is triggered twice: Any suggestion?...
7
by: bookon | last post by:
I was running into the System.Drawing.Image.FromStream "parameter is not valid" on some of the images I was retrieving from a blob column in Sql Server. I thought there were corrupt images as...
3
by: boeledi | last post by:
Dear All, (First of all this is not a c# piece of code but it does not really matter). I would really appreciate if someone could help me. I am developing an ASP.NET web site and I have to...
4
by: gerardianlewis | last post by:
Any help appreciated. (VB.NET under XP and Vista, SP1 installed) My code, inherited from a VB6 version of an app that ran under W98, loads an image from a file into a PictureBox. The user may...
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: 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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.