graphics

Binding to a collection of shapes?

How would I bind to a collection of shapes? I'd like to build a small application (just for learning purposes) where I utilize MVVM for drawing shapes. The DataContext of the MainWindow is the MainWindowViewModel That MainWindowViewModel has an ObservableCollection of shapes. I have currently only a Canvas on my MainWindow with it...

How can I underline some part of a multi-line text with GDI?

I am using Graphics.DrawString to draw my usercontrol's text like this: protected override void OnPaint(PaintEventArgs e) { RectangleF bounds = DisplayRectangle; bounds.Inflate(-4, -4); // Padding StringFormat format = new StringFormat(); format.Alignment = StringAlignment.Near; format.LineAlignment = StringAlignment...

Loading an image from memory, GDI+

Here's a quick and easy question: using GDI+ from C++, how would I load an image from pixel data in memory? ...

LPD3DXFONT DrawText using DT_CALCRECT?

How do I use DT_CALCRECT to determine my rectangle bottom and right coords? e.g I have this rect: RECT textPos; textPos.left = 100; textPos.right = 100; What do I do next to calculate the rect and draw the text? ...

building website graphics with GWT

hi, i am building a site with GWT. i have finished all the logics and now i need to work on the graphics/UI. i am just begining my way at web site and i have 2 questions: 1) how can i make my web site look good in every resolution? 2) in most of the places i have read that the UI components (background/buttons..) is always in a tab...

How to make sure if a polynomial curve is monotonic under interval [a,b]?

Hi, guys, If I got a polynomial curve, and I want to find all monotonic curve segments and corresponding intervals by programming. What's the best way to do this... I want to avoid solving equation like f'(x) = 0; Using some nice numerical ways to do this,like bi-section, is preferred. f'(x) expression is available. Thanks. Add addit...

Flex 3 and scaling DropShadowFilter

I have an application that requires resizing of a component that will be scaled up and down quite frequently. I noticed that when I scale the component, any filter I use on it will not scale with it. I realize this makes sense, but I was wondering if Flex had a tool built in that would allow me to scale the filter with the component. I k...

Drawing and clearing the desktop canvas with Delphi

I'm trying to draw over the whole screen by using the desktop canvas and painting to it directly. The problem is I can't clear that desktop canvas. I've tried setting the canvas.pen.style to psNotXOR and draw over the old image but unfortunately, this is not reliable enough and some left overs are still present in some conditions. My ne...

How do I position lines exactly in C#

I do NOT want the system trying to scale my drawing, I want to do it entirely on my own as any attempt to squeeze/stretch the graphics will produce ugly results. The problem is that as the image gets bigger I want to add more detail rather than have it simply scale up. Right now I'm looking at two sets of stripes. One is black/white, ...

Can I set text on a flex Graphics object ?

Is there anyway I can effectively call the equiv. of setText on a Flex Graphics object ? Specifically I'm using a custom cell renderer to display data in a datagrid. The renderer uses the Graphics object to set the background colour of only a portion of the cell (say the left half) based upon the underlying data. I would like to be able...

Graphical Bugs while programmatically creating UILabel, UITextField, etc...

I programmatically created a login view and a table view. Under certain circumstances which i cannot reproduce there occur some strange visual bugs: Text with some letters having a different font size than others A button where the border is not initially shown but only if you click on it. In the same case, the border of the button ca...

Confused in DDA algorithm , need some help

Hi Friends, I need help regarding DDA algorithm , i'm confused by the tutorial which i found online on DDA Algo , here is the link to that tutorial http://i.thiyagaraaj.com/tutorials/computer-graphics/basic-drawing-techniques/1-dda-line-algorithm Example: xa,ya=>(2,2) xb,yb=>(8,10) dx=6 dy=8 xincrement=6/8=0.75 yincrement=8/8=1 ...

How can I extract all default skins / styles / icons etc. from my Flex app?

I'm developing a Flex application. Since I'm not a very talented graphical designer, I leave all stylings etc. at their defaults. Once I finish the app, I would like to give it to a graphical designer, together with all the fonts, icons, styles etc. that Flex has put into my app, so she can swap them out and make my app pretty and theme ...

What is the proper way to use GFX rotozoomSurface with SDL for drawing transparent sprites?

I'm using the latest SDL/GFX libs on Fedora 10 and I'm trying to render a PNG or GIF image onto the screen surface. I could not get transparent PNG's to display at all so I replaced the transparent parts or my sprite with all white (and tried Magenta 255,0,255). The white-transparent PNG displays fine using this code: SDL_Surface *image...

How to make an image as transparent in BlackBerry?

I am new to BlackBerry Java application development. My scenario is: In my application a gallery list of images will be displayed in a small icons. If I click on any image it will display in a large mode. Here I need to provide controls like front and back buttons. On clicking on those buttons the background image should change. In addit...

.NET graphics Ghosting

I'm making a sample GUI for a new application we are developing at work. The language has already been decided for me, but I am allowed to use any 3rd party DLLs or add-ins or whatever I need in order to make the GUI work as seamlessly as possible. They want it very mac/ubuntu/vista/Windows 7-like, so I've come up with some very intere...

White lines around round border at high zoom level

If I zoom large enough in xamlpadx (500%) I see while lines around the inside of the border. In my app this even happens at normal zoom level in some controls. Why is that and more important, what can I do about it? This is my XAML code: <Border Background="#000000" BorderBrush="#000000" BorderThickness="4" CornerRadius="4"> <...

Best algorithm for matching colours.

Hi, I got array of some (about 200) colours in RGB format. I want to write program that taking any RGB colour and trying to match colour from my array that is most "similar". Of course I need better definition for "similar". Unfortunately I don't have any. It want it to act like a parson asked the same question. I want to show some inf...

How can I turn on (change color) of a single pixel by coordinates in WPF.

Hello.I have seen similar questions on here but haven't found an answer.I'm taking a computer graphics course in college and we are taught different algorithms that are used to display shapes.My assignment is to choose any development platform and implement these algorithms.Since I have experience developing in WPF, I want to use it for ...

Basic Open GL/GLUT Issue

I am studying graphics and currently using OpenGL with GLUT. Doing my editing in codeblocks and using an online tutorial located at lighthouse3d. I am using the main method declared on that page however it will not let me compile. The error message consists of the main method not returning an int, I have "played" with the code enough to ...