|
Looks to me like you're asking for a blur filter, because you want to 'antialias' a bitmap, when the method really works when you're in the process of drawing lines. If you read my image prcoessing articles, I talk about bilinear and bicubic filters there. Basically, what antialiasing does, is it says for an edge pixel, I really want to only draw on x% of this pixel, but as that's not possible, I merge the color of the underlying pixel with the color I want to draw, so it's x% the color I want to draw, and 100-x% the color that it was before.
The issue you will have is working out both which areas you're antialiasing ( assume all the pixels that differ ), and how much they need to be antialiased, which is probably impossible to work out. Some sort of general algorithm that does a good enough job to improve your image is probably fairly easy, however.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
"Looks to me like you're asking for a blur filter, because you want to 'antialias' a bitmap, when the method really works when you're in the process of drawing lines."
Say you have some text or other shape on a monochrome bitmap. Are you saying its not feasible are hasn't been conceived of for an algorithm to examine the contour (i.e. border) of this shape and produce a smooth (anti-aliased) version as output, on a target bitmap? Or are you saying this is what a "blur filter" would achieve?
OK here's my application: bitblt-ing textured text to the printer. The resolution of the screen doesn't come close to matching the printer resolution, so I have to smooth it out somehow. I'm using NT, actually, not a newer windows variant.
Actually, the texture on the text is rendered correctly on the printer, but the outline of the font is jagged.
|
|
|
|
|
Force Code wrote: Are you saying its not feasible are hasn't been conceived of for an algorithm to examine the contour (i.e. border) of this shape and produce a smooth (anti-aliased) version as output, on a target bitmap?
No, I"m saying it's bloody hard work, and if you also have the bitmap WITHOUT the text, to provide the background, you'll get a better result for less hassle if you just rewrite the text with anti aliasing.
Force Code wrote: Or are you saying this is what a "blur filter" would achieve?
A blur filter will recolor all pixels based on the surrounding colours, which will in effect do what anti aliasing does, but blindly and everywhere.
Depending on the nature of the image, a gaussian blur, or similar, may produce an improved result. It may also make it worse
Is the text the only black area on the bitmap ? Do you know where it is ? If you know the area to look, or can identify text, then you can write some code to blur the edges, pretty trivially, which will not be quite what you're looknig for, but it's what I had in mind when I said you could write something easily that won't be 100% what you want, but could give enough of the effect to solve your issue.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
As it turns out the AGG project does have some code that I can pretty much paste directly into my project. Actually, its a five hundred line Hello World program[^] that renders text utilizing their Anti-Aliasing process.
|
|
|
|
|
Force Code wrote: As it turns out the AGG project does have some code that I can pretty much paste directly into my project. Actually, its a five hundred line Hello World program[^] that renders text utilizing their Anti-Aliasing process.
I copied this into a test program, compiled it, and it did nothing. So, I replaced their "render_text(ras, ren, sl, gl, 10, 100, "Hello, World!")" with a straight win32 TextOut, and got impeccably rendered "Hello World" output indistinguishable from what AGG supposedly produces. But then, I noticed in their code they were calling the Win32 CreateFont with ANTIALIASED_QUALITY specified. So, I have no idea what AGG achieves on its own. As it turns out, ANTIALIASED_QUALITY was all I needed in my own project to begin with. I was utilizing someone else's code in which CreateFont was called with DEFAULT_QUALITY.
So anyway, nevermind.
|
|
|
|
|
Force Code wrote: I copied this into a test program, compiled it, and it did nothing. So, I replaced their "render_text(ras, ren, sl, gl, 10, 100, "Hello, World!")" with a straight win32 TextOut, and got impeccably rendered "Hello World" output indistinguishable from what AGG supposedly produces. But then, I noticed in their code they were calling the Win32 CreateFont with ANTIALIASED_QUALITY specified. So, I have no idea what AGG achieves on its own. As it turns out, ANTIALIASED_QUALITY was all I needed in my own project to begin with. I was utilizing someone else's code in which CreateFont was called with DEFAULT_QUALITY.
Here's an interesting epilogue to this story.
I recently downloaded GDI+ which I haven't used before. As I said above, just using the straight GDI CreateFont (or actually CreateFontIndirect) and specifying ANTIALIASED_QUALITY, gives you as good text quality for large fonts as could possibly be imagined.
So I was curious about the capabilities of GDI+. With it, you call,
graphics.SetTextRenderingHint(TextRenderingHintAntiAliasGridFit), which gives you the highest quality fonts available through GDI+ for non XP systems (I am using Win 2000.) So I tried it and amazingly, the quality was *much* worse than with straight GDI. It looked like it wasn't anti-aliased at all, until you notice that yeah, it is a *little* bit smoother (This was on 72 point Times New Roman; bold, italic).
This is very strange, since GDI+ itself uses over 180 GDI functions. There is one higher quality font level available in GDI+, only for XP and Win Server 2003 - TextRenderingHintClearTypeGridFit. It supposedly uses revolutionary "ClearType" technology.
I think its clear that what happened is that Microsoft just downgraded font rendering for everything prior to XP, and made their old anti-aliasing algorithm only available for XP or higher, and gave it a new name - "ClearType".
Maybe this has been observed before.
|
|
|
|
|
Guys,
I'm trying to look for the best graphics toolkit to help me out in creating my new application. I'm not sure whether I should choose OpenGL with SDL, Microsoft XNA, etc...
Here is a brief idea about the application:
The Warehouse Watcher is a visualization system that helps warehouse personnel see the warehouse in front of their eyes, navigate through it, and get the information required in significantly lesser time.
Display
The WW system displays warehouse(s) in 3D. It should be capable of displaying one or more warehouses based on the customer needs. The primary objects to be displayed in a warehouse are locations, pallets, items, and labels. The secondary objects are forklifts, staff offices, conveyers, workers, trucks, and other objects that make the graphical representation of the warehouse more realistic. The objects must be displayed in right scale and with appealing graphical representations.
Navigation
The user will have the capability to walk through the warehouse. The user can look and move in any direction. S\he will have the option of exiting the warehouse through its doors and entering into another warehouse. A collision detection system must be implemented in order to make the user’s movement more realistic. The user has the option of whether to enable collision detection or disable it. The user will also have options of magnifying objects, looking into their details and rotating them. The user will also have the capability to increase\decrease his\her speed while walking\running around the warehouse.
Selection
While navigating, the user must have the option of selecting a certain object and looking into its details. When the mouse moves over a certain object, it must be highlighted. This functionality is optional as it would affect performance. In order to implement the selection and highlighting of objects, the selection mode picking method must be used in order to keep track of all objects displayed in the 3D coordinate system. When an object is selected, the user will be taken near to that object and the major information about the object must be displayed on a side pane.
Search
So we were able to walk around the warehouse and navigate the objects, but what if we really want to check a single SKU? Walking around and trying to find this SKU manually will be as much headache as trying to find it physically. That’s why the search functionality would prove to be very useful in trying to find specific objects in the warehouse. For example, if the user is trying to see how an SKU is distributed in a warehouse, s\he can simple search for it, and the system will highlight all the occurrences of this SKU in the warehouse and take the user to its first occurrence.
Data Analysis
This should be the most important part of the project and the reason why a customer would purchase such a product. This part would analyze the customer data and give customers key performance indicators and tips on improving their warehouse operations.
Database Connectivity
Libraries I am thinking of are DLINQ and NHibernate.. Would appreciate if someone can tell me which is better it if there is some other alternative.
Best Regards,
Ali B,
|
|
|
|
|
DirectX is the most obvious, seeing as you want to use LINQ, which means managed code.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hey,
Thanx a lot for your help. I'll check if I'm going to use DarkBasic or DarkGDK.
Best Regards,
Ali B,
|
|
|
|
|
i develop a school project with cxp api's. I have a problem about handled video screen. i want to capture a screen shot from handled video screen...
what should i do for this issue ?
((VideoCapability)goruntu[listView2.SelectedItems[0].Text]).VideoWindowHandle = pictureBox1.Handle;
from the pictureBox1
thanx
Vedat Mert Güneri
-- modified at 13:04 Monday 11th June, 2007
|
|
|
|
|
can anybody tell how to use Slice tool in photoshop?how can we convert a phtoshop template in to a web site?pls explain..i m very good in photoshop and web template making..but i dont know how to convert it in to a web site..pls explain n help me out..
|
|
|
|
|
You have to cut it up into pieces and then put those pieces into a web site through img controls, and do as much as you can using CSS instead
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
my program contains a rather time consuming loop to send newsletter emails (in no separate thread). Within this loop, the screen shall be updated after every loop circle, i.e. after every message being sent (simply updating the number of the sent messages and setting a hook in the addressees grid). So far no problem. Now, after some minutes running the procedure alone, the standard win logo screensaver absorbs the screen. And if I'm now returning to my program window by hitting any key, the screen gets frozen, although the program behind keeps running well. The screen will not be updated until the whole loop has been worked off. This happens although there is a .refresh command in every loop circle.
Does anybody have a piece of advice how to fix this?
Cheers,
Wolfgang, Berlin/Germany
|
|
|
|
|
What language is your code? Using .NET?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hi Mark,
I'm using VB.NET.
Wolfgang
|
|
|
|
|
Hmmm... I'm not a VB coder but...
You mentioned you call .refresh every iteration of the loop. Are you referring to the
Control.Refresh() method? If so, are you calling it on just one control or on the window itself?
This type of problem is common when you are consuming all of the UI threads time and not
allowing windows messages to get dispatched.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Well, actually I'm calling both, the Me.refresh (which presumably corresponds to the this.refresh in C#) at the beginning, and the control.refresh method at the end of each loop circle, but this doesn't help. It seems that at runtime the screen upadate is being postponed behind the other programmatical tasks of the loop as a kind of secondary task.
If so, what would you recommend to give the screen update back its demanded priority?
Wolfgang
|
|
|
|
|
When the screensaver is removed, all windows will be invalidated and eventually will redraw
themselves. If you are in a loop then the WM_PAINT message sent to the app as a result of this
invalidation will not get processed until the loop ends.
That, said, I would expect Refresh() to immediately redraw the window. Maybe I'm wrong about
that. What you're describing sounds like the delayed WM_PAINT handling described above.
Maybe try this every iteration of your loop (I'm assuming Me is a form, not just a control on a
form - I'm not a VB coder so I don't know what "Me" generally is ):
Me.Invalidate();
Me.Update();
instead of Refresh();
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hi Mark,
meanwhile I tried your suggestion. Result: negative. With the .invalidate() and the .update() command the form doesn't redraw itself at all, not even before the screensaver has been invoked. And the documentation of the .refresh() method in principle promises exactly, what I'm looking for: "... Forces the control to invalidate its client area and immediately redraw itself and any child controls. (Inherited from Control.)" But it doesn't do so, unfortunately.
Do you have any further idea, how I get my app paying attention to the WM_PAINT handling, after the screensaver has been removed (if this is the real problem)?
Greetings from Berlin, Germany
Wolfgang
|
|
|
|
|
What happens if you drag another window across your app's form when it's in the loop?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hi Mark,
unfortunately, I've to leave immediately for a business trip until June, 22nd (I'm somewhat in a hurry to get the plane...). I'm going to try later what happens when dragging another window across the loop's form. So far thanks for your efforts, I get in touch with you as soon as I'm back.
All the best
Wolfgang
|
|
|
|
|
... not to forget, Mark, that the problem doesn't occur as long as the screensaver isn't interfering. This, i.e. the win screensaver, seems to change the preferences in the GUI of my program.
Wolfgang
|
|
|
|
|
yes another bone and vertex question...
I got my bone-system to work properly and I already modelled some simple characters in 3ds Max... the problem now is:
how do I assign the different vertices to my bone system?
Can I use some scripting in max? or should I use a different file-container different from .3ds?
the problem of 3ds is that I cannot assign vertex groups... Or when I do put them in a group the edges between the objects get broken.
I have got a pretty good 3DS-Loader but assigning each vertex to a bone by hand is... well... damn enerving. should I convert my model or is there a way of marque selecting vertices and grouping them (and the faces don't get broken) so I can find those groups for my bones system?
Or is it simpler to try to write an algo that assigns each vertex to the nearest bone (and correcting this result by hand)??
thanx in advance
(PS: I'm using OpenGL and C++, of course)
|
|
|
|
|
zqueezy wrote: I'm using OpenGL and C++, of course
http://home.gna.org/cal3d/[^]
http://download.gna.org/cal3d/documentation/modeling/tutorial.html[^]
not sure if you are wanting to do it all yourself, of find a library that does it for you (and then you are restricted to its bone design). At the very least you can peek at the code and see how they do the binding.
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
Hi,
I am writing a game and planning to use DTED files for terrain generation.There is an example(http://www.geocities.com/oldjajubear/dtedview.zip) for viewing in 2D. I just need the help of this forum in using DTED+OpenGL to modify this code
to disaply DTED in 3D.
|
|
|
|
|