|
thanks man
|
|
|
|
|
Hi,
Sorry about my english at first.
i am doing mobile education project in CF. while students solving questions, they must solve questions with using touchpad only. (not use of paper) I showed questions in a picturebox(1 question per 1 picturebox. For every question there is forward button.) But at the solution process i dont want to change image of picturebox (re-usable) so i think about a layer for paperwork only. and also if student moved on to other question,the paperwork thing must exist also (if student want to come back to question.).
is there a way to edit or add picturebox for a layer?
(C#-Visual Studio 2005-CF)
Quiet important thanks
modified on Tuesday, January 22, 2008 8:38:48 AM
|
|
|
|
|
I noticed that I'm not the first person to ask this question. "levgiang" has also asked a similar question.
What would be the recommended ways of saving a series of computer generated bitmap (frames) to an animated file format. I'm creating a series of computer generated bitmaps/images and I would like to find an expedient way of saving the frames in a popular animation file format so that the entire series can be independently viewed in a generic windows media player.
As a follow up question, what would be the recommend ways of reversing this process, where I retrieve an animated file into a C# or VB program so that the individual frames can be separated out for further processing.
I'm currently teaching myself Visual Studio Express 2005 using VB and C#.
BTW, would it help to upgrade to Visual Studio 2008?
Thank you for your help!
Steve
www.OrionWorks.com
www.zazzle.com/orionworks
|
|
|
|
|
Hello.
How would I make my game draw a new Texture2D that goes the way the right analog stick is facing when the right trigger is down? (think Geometry Wars, etc.) I have the things needed for the stick (enum direction) and trigger (bool isRightTriggerDown), but I don't understand how to draw the new sprites, or atleast how to make them move seperately than each other in different directions. Would I use a for loop to draw how many is needed, or what. Help would make me very happy. Thanks for reading, at least. (and in advance)
- I love D-flat!
|
|
|
|
|
Hi all,
When I call IDirect3DDevice::BeginScene method, the returned error is D3DERR_SCENE_IN_SCENE.
Please tell me how to fix this.
Thank you.
|
|
|
|
|
Just a guess: I suppose you'll get this error when you call BeginScene twice without having called EndScene in between.
|
|
|
|
|
Yes, the problem is when I change the screen solution, something wrong happens and prevents the EndScene() call. So when the next BeginScene is called, it returns this error.
This is fixed. Anyway, thank you very much for your answer
|
|
|
|
|
Is it possible to use DirectX to render a 3d scene to a Bitmap instead of to a screen?
Using C# .Net 2 on XP.
It's not really suitable to put the render code into the paint event and then repeatedly call this.DrawToBitmap , so is there another way? Rendering to the Window is fine but so long as I can get the last rendered scene to a Bitmap (without having it re-render).
The reason I need the bitmap is because the image needs to be used again, such as in other windows (without having a bunch of near-identical and wasted devices). I suspect this may involve use of Surfaces?
Ninja (the Nerd)
Confused? You will be...
|
|
|
|
|
ive developed program using opengl with C for image processing operations and i run the code using visual studio.everything was working good for 256x256 images.but when i use images of more pixel size ...im having trouble with Fourier transformation.
if anyone know how to solve the error i will mail the code as it is lengthy...
|
|
|
|
|
kanika wrote: im having trouble with Fourier transformation.
Um, it would help if you said what kind of trouble.
kanika wrote: everything was working good for 256x256 images.but when i use images of more pixel size
Does the Fourier transform routine you're using have a requirement that the image size be a power of 2 and the larger images you're feeding it don't conform?
Believing in bullshit doesn't make it true.
|
|
|
|
|
yes,fft have to check the image size to power of 2.my code have 3 windows orginal image,source image and destination.when i give images less than 256x256 or more than 256z256 i cld get the output...but the image is disturbed in the related windows.
|
|
|
|
|
kanika wrote: when i give images less than 256x256 or more than 256z256 i cld get the output...but the image is disturbed in the related windows.
Is there a fundamental limit to image size for the routine which might be 256x256? It's kind of a suspicious since it represents 64k pixels which is the limit for an unsigned 16 bit integer.
Believing in bullshit doesn't make it true.
|
|
|
|
|
Hello. It may seem like a beginner question, but I'd like to know how to draw a line. Simple? I've been looking all over the net, and through these books I have, (also CodeProject) and nothing "works". Please help, thanks in advance.
- I love D-flat!
|
|
|
|
|
Hi,
for the Form, Panel, or whatever Control you want to draw on, use the OnPaint handler
(or add a new handler to the Paint event); it will give you a PaintEventArgs offering
a Graphics object, then use Graphics.DrawLine() and the like.
If you need examples, there are plenty around at CP. My Sokoban article also has some
line drawing.
[ADDED] just noticed some essential info got hidden in the subject line;
for XNA things are a bit more complicated, but they do provide some documentation,
so this may help[^].
[/ADDED]
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
modified on Sunday, January 13, 2008 5:03:32 PM
|
|
|
|
|
Oh, I know how to draw lines there. That's easy. BUT, in XNA, it's a whole new territory.
To your added reply, I've seen that, and tried, but wasn't sure what type the variables were when previously declared (they didn't show it there).
Example: points?
(My bad, I had pointList; it was points)
- I love D-flat!
modified on Sunday, January 13, 2008 5:10:42 PM
|
|
|
|
|
Not sure if this can be done simply, but hoping it can be. I want to draw shapes anywhere on the screen, regardless of my forms location. I want to be able to draw off the form. Can anyone provide guidance or even an example?
|
|
|
|
|
The ANZAC wrote: I want to draw shapes anywhere on the screen, regardless of my forms location. I want to be able to draw off the form.
You can't. You can only draw on your form.
|
|
|
|
|
|
i don't know, if this is what you are looking for, but i found that piece of vb.net-code on a cd:
<br />
Private Declare Function GetDC Lib "user32" Alias "GetDC" (ByVal hwnd As Integer) As IntPtr<br />
Private Declare Function ReleaseDC Lib "user32" Alias "ReleaseDC" (ByVal hwnd As Integer, ByVal hdc As IntPtr) As Integer<br />
<br />
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
Dim blackPen As New Pen(Color.Black, 3)<br />
Dim dc As IntPtr<br />
Dim g As Graphics<br />
<br />
Dim rnd As New Random()<br />
Dim i As Integer<br />
dc = GetDC(0)<br />
g = Graphics.FromHdc(dc)<br />
For i = 0 To 1000<br />
g.DrawLine(blackPen, rnd.Next(600), rnd.Next(600), rnd.Next(600), rnd.Next(600))<br />
Next<br />
g.Dispose()<br />
ReleaseDC(0, dc)<br />
End Sub<br />
click on the button to draw a bunch of lines to the screen, independent of your form.
is this of any help?
"I love deadlines. I like the whooshing sound they make as they fly by." (DNA)
|
|
|
|
|
hey,
can someone suggest good book or online material on 3d mesh manipulation that starts from basic concepts
thanks
|
|
|
|
|
The book 3D Computer Graphics, by Alan Watt, published by Addison Wesley, is really excellent.
|
|
|
|
|
I'm using GDI+, and want to edit the pixels of an 8 bit-per-pixel, grayscale bitmap which I read from a file. I can get the pixels using the Bitmap::LockBits and BitmapUnlockBits methods and a BitmapData object. However, there doesn't seem to be any support for 8 bit-per-pixel bitmaps that do not necessarily use a palette (i.e. grayscale).
I see that the pixel format can be set to PixelFormat8bppIndexed, and used along with a palette (the palette type can even be set to PaletteFlagsGrayScale). However, it is unnecessary to use a palette with these bitmaps, as the palette just contains all possible gray levels. It seems inefficient to have to associate a palette with these bitmaps and pass it back and forth each time the pixels are retrieved (the pixels are frequently and repeatedly passed back and forth for editing in my program).
Does anyone know:
1) Are there any other flags or methods for using BitmapData objects with 8 bit-per-pixel grayscale bitmaps but without a palette?
2) When the PaletteFlagsGrayScale flag is used, can I assume the palette entries are always the same (all possible gray levels)? Or can they be re-scaled? (I understand that these entries are DWORDs using alpha | red | green | blue, with the red, green and blue values equal to each other.)
Thanks!
|
|
|
|
|
Hi,
I have a windows CE device for which I am wrinting a C# .Net CF 2.0 application.
This device has an inclinometer chip connected to it, which reads the angles my device is at, and sends me the X and Y tilt values of the inclinometer.
Depending on those values, I want to display a picture. (.png). For now now I'm just using the X value (tiltX global variable)
The image is being updated every 150ms
So for a prototype I've being doing the following:
//TiltX is being passed in to RotateGauge as an Int.
private void RotateGauge(int side)
{
if (side > -5 & side < 5)
{
string number = Convert.ToString(side);
Stream sidePic = _assembly.GetManifestResourceStream("Rotate_Test.images.gauge.sideTilt" + (number) + ".png");
Bitmap bmp = new Bitmap(sidePic);
Graphics g = CreateGraphics();
g.DrawImage(bmp, 42,116); //draw image
bmp.Dispose();
sidePic.Close();
g.Dispose();
}
}
The above function RotateGauge() gets called from a timer. (interival 150ms)
The problem is its using up a lot of memory. I don't think I'm properly disposing of things.
Any suggestions how to : Efficiently rewrite the above code so when something gets created on a timer_tick it also gets disposed of properly
|
|
|
|
|
Hi,
I don't see anything wrong with your object disposal, so I expect the garbage collector
will clean up memory if need be.
However I think you are spending way too much CPU power to achieve your goals. This is
how I would do it:
- replace the PictureBox by a simple Panel (or an inherited Panel that sets its
ControlStyles to double-buffered for better graphics);
- do the drawing in the Panel's OnPaint method, based on a single class member (int side);
it gives you a Graphics for free (which you should not dispose!);
- when you want to change the gauge, change the variable (side) and call your Panel's
Invalidate method
If you only have a dozen PNG images, you may even consider keeping them alive in memory
all the time.
|
|
|
|
|
Hey Luc. Congratulations on your MVP status. It's well deserved.
|
|
|
|