|
What exactly are you trying to do? Are you attempting to texture some object with said bitmap?
Need more information.
L u n a t i c F r i n g e
|
|
|
|
|
u may need to used blending. opengl supports different blending operation between source and destinations. u can use the function glBlendFunc(..) to define the operations. first u need to enable
blending by calling glEnable(GL_BLEND)
If u can Dream... U can do it
|
|
|
|
|
I think this problem occurs because of x and y of points because when I change the points, the shape will fill correctly.
Here is the code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
namespace FillTriangle
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
GraphicsPath gp = new GraphicsPath(FillMode.Winding);
gp.AddLine(new PointF(290, 170),new PointF(98, 128));
gp.AddLine(new PointF(110, 170), new PointF(290, 170));
gp.AddLine(new PointF(110, 170), new PointF(98, 128));
g.FillPath(new SolidBrush(Color.Red), gp);
}
}
}
|
|
|
|
|
WDI wrote: I think this problem occurs because of x and y of points because when I change the points, the shape will fill
Of-course the problem is occurring because of co-ordinates x and y.
modified on Tuesday, December 21, 2010 12:08 AM
|
|
|
|
|
hi everyone..
I want a tool to plot real time graph for .net platform.The data which has to be plotted is continuously coming in some time interval.Is there any tool available?
Also Performance issue is there.Performance also matters when I am using the tool.
Thanks in adv...
|
|
|
|
|
Please do not ask the same question in more than one forum. Very rude and it wastes everyone's time.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I know it wastes time of many people.But I don't know in which forum it should post.Thats why I posted it in multiple forum.Well thanks for suggestion and sorry for westing your time.
|
|
|
|
|
Since your question mentions the fact that you want to do this in .NET I would expect the .NET Framework forum would be a good start. I note that you have been a CP member for over a year now so you should be familiar with the posting guidelines.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
This statement is going to one of my pgm docs. It's no big deal, I just want to know if anyone recalls a doc?
I know I haven't run across one and this took a while to debug.
Working with monochrome bitmaps and DCs introduces a surjective-only mapping of 32-bit COLORREF values
onto 1-bit mono pixel values (as in FillSolidRect(), e.g.). Here is the map:
0x00000000 <= '0' <= 0x00000fff
0x00001000 <= '1' <= 0xfffff000
I don't know about adding more bitplanes to the bitmap.
Tadeusz Westawic
Sum quid sum.
|
|
|
|
|
I have recently discovered that
dc.SelectObject(&mybitmap);
...
dc.SelectObject((CBitmap*)NULL);
does not cause the release of mybitmap.
What is the proper way to cause dc to release bitmap without assigning another "real" resource (return the dc to its freshly created state) so that another dc in another subroutine can select mybitmap?
Tadeusz Westawic
Sum quid sum.
|
|
|
|
|
The first call to SelectObject will have returned a handle to the default bitmap in the DC. Store it and select it back in when you're finished.
L u n a t i c F r i n g e
|
|
|
|
|
Yes, thank you, it is the way I used to do it.
Let me ask this, then: what does the dc.SelectObject() doc (msdn) mean in explanation of return value, where it says about func may return ptr to temp object?
That is the thing that scared me off the tried and true.
Tadeusz Westawic
Sum quid sum.
|
|
|
|
|
See here[^], if you haven't already.
L u n a t i c F r i n g e
|
|
|
|
|
GDI works with handles: HDC for device-contexts, HBITMAP for bitmaps, and so on.
MFC provides a wrapper class for each entity provided by GDI: the CDC class wraps a device-context and internally holds an HDC , the CBitmap class wraps a bitmap and internally holds an HBITMAP and so on.
When you call CDC::SelectObject() , it returns a pointer to the appropriate MFC class that represents the GDI object previously selected into the device-context; these pointers are obtained calling the FromHandle() method (e.g. in case of a bitmap object CBitmap::FromHandle() is called).
The pointers obtained in this way could be temporary because, if your application reach the idle state, i.e. its CWinApp::OnIdle() is called, the objects pointed are deleted; this doesn't mean that the underlaying handle is destroyed, but only that the wrapper class is destroyed. As a conseguence, you cannot store such a pointer to use it later: you should select it back into the device-context before returning from the current message handler.
|
|
|
|
|
That is a great answer; I now understand completely.
Thank You
Tadeusz Westawic
Sum quid sum.
|
|
|
|
|
using the sharelist API we can using the same list in diffrent RC, but how can the diffrent DC share the same OpenGL List? thanks
|
|
|
|
|
Asking the same question twice in a row is not considered appropriate in the CP forums. If you don't get an answer, maybe you should consider modifying your question.
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
as far as opengl is concerned it just execut the opengl commands to the active context.for a single thread we can have only one active context.u can create a context using wglCreateContext function.
to make it active u need to call wglMakeCurrent.
so u can swith DCs by calling wglMakeCurrent function.
if u need to draw simultaneously to two DCs u need to have two threads.
If u can Dream... U can do it
|
|
|
|
|
diffrent RC can share the same openGL list, but can diffrent DC share the same list?
thanks
|
|
|
|
|
A display list could be shared between multiple rendering context; it doesn't matter the device context to which each HRC is related. Then the answer is yes.
|
|
|
|
|
Please help find the source of the program determine authenticity photos ......
I saw it on the site, but forgot her path.
|
|
|
|
|
Hello,
I found the following code to create a MultiFrame image in C#[^] and used it on 3 jpeg files. The file sizes were 96 KB, 103 KB and 82 KB. However, the output file was 2.7 MB.
It seems like the process is decompressing the jpegs or something. I tried to add another parameter to set the quality, but I really don't want to decrease the quality or change the dimensions.
I'm basically trying to find the simplest methods to put the images into an "archive" that I can then read and separate the images at a later time. I don't want to use zip files. I just want to append all images and read them back via offsets and a binary reader and then display the images in a picture box. I'd like to also store these offsets in the output file as some sort of "header" record if possible. I'm trying to keep it simple and the output file size around the same size as the originals.
Any thoughts here on the MultiFrame size issue or a sample of how to create a some "archive"?
Thanks,
Chris
|
|
|
|
|
If you read the documentation accompanying the sample, it says bitmaps are created from the supplied images and then saved in a tiff format; so yes, the images are decompressed before saving. (Tiff supports various compression schemes, but the sample doesn't give any details as to the particulars of the tiff encoder, and the result implies compression of the tiff was minimal, if employed at all.)
If you're just trying to save the original images into a signle 'archive' file, just open a binary file and write the images into it, one after another. That'll preserve whatever encoding/compression scheme was used in the original image files. It'll be up to you to maintain some sort of index data giving file sizes and/or offsets into the binary archive so you can pull individual images out when you want. As you say, you could create a data structure for this purpose and put it at the head of the file where it'd be read first. Make the first member in the structure the number of images it contains, followed by size and offset for each individual image contained in the archive. It should be fairly simple to implement this, once you've worked out the details of your desired scheme.
L u n a t i c F r i n g e
|
|
|
|
|
Ah, the old RTFM gotcha. Oops! I really need to pay closer attention. LOL
Yeah, I just decoder to append the images together, which keeps the size close. Now i'm just trying to work out saving off the indexes in the same file.
Thanks for bringing that to my attention.
Chris
|
|
|
|
|
glut provide some API to draw sphere such as glutSolidSphere and glutwireSphere. I want to draw 3D earth with diffrent resolution texture like google earth. but the glut API can not realize, where can i find some useful knowledge about it? thanks
|
|
|
|