banner



How To Display Image In C# Windows Application

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is costless. Click here to register now.

  • Digital Design and Embedded Programming
  • Digital Signal Processing
Y'all are using an out of appointment browser. It may non display this or other websites correctly.
You should upgrade or use an alternative browser.

how to display an image using C or C++?

  • Thread starter nikhat_ahir
  • Kickoff engagement
Status
Not open up for farther replies.
  • #1
Joined
Mar 17, 2008
Letters
7
Helped
0
Reputation
0
Reaction score
0
Bays points
ane,281
Location
india
Activity points
1,370
c++ brandish image

i want to display bitmap image using c or c++.
i one thousand getting problem with putpixel(10,y,color) function, as it takes only upto fifteen for color argument.
is at that place any other way to display image in C or C++?
waiting for kind replies.

thanks, and regards,
nikhat ahir.

  • #2
display image c++

You're using the graphics.h library which is from the 80's. So as far as I know you're stuck with those colours.

You accept a couple of options, neither of which are specially like shooting fish in a barrel. Yous can use visual c, and create a Windows program, then you have rgb(255,255,255) colours. But if y'all've never programmed in visual C and then in that location is a pretty steep learning curve.
The other option is to employ the allegro graphics library (I've never used this, and so I tin't annotate too much on information technology), which is freely downloadable and is supposedly not to complex. You could also attempt dirextX, but I believe information technology is much more than circuitous.

  • #3
Joined
Mar 17, 2008
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
india
Activity points
i,370
c++ show epitome

howdy,
thanks for suggestion. but, i need to display epitome using C or C++ lawmaking only.
i know vc, java, and even better for paradigm processing, i also know matlab.
just, i demand to display epitome in C or C++.
is there any style to put pixels having color greater than 16, such every bit 256 color (8-bit) image.
waiting for replies.

thank you, and regards,
nikhat ahir.

  • #iv
display epitome in c++
howdy,
thanks for suggestion. but, i demand to brandish image using C or C++ code simply.
i know vc, coffee, and even better for paradigm processing, i also know matlab.
simply, i need to display image in C or C++.
is there any manner to put pixels having colour greater than xvi, such every bit 256 color (viii-bit) image.
waiting for replies.

cheers, and regards,
nikhat ahir.


And that's exactly what I've told you to practise!!!!
  • #five
Joined
Mar 17, 2008
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
republic of india
Activity points
ane,370
c++ epitome brandish

man, my requirement is to display image in C or C++. else, u wouldnt have this question.
exercise u know how to display this i?
if not, its ok.
i m trying. and, i vl display it in C/C++. i m confident for it. okay?

thanks,
nikhat ahir.

  • #6
c display image

man, yes I do know how to do information technology, and I've already told yous how to. And I don't appreciate your patronising tone, when I've answered your question. You may non similar the answer, but information technology is the answer none the less.

you lot are using the graphics.h library which is an sometime borland c library. That library is a relic from the lxxx's hence it's limited colour capabilities.

But to create a console app with some graphics it was OK in it'south twenty-four hours.
To do what you desire y'all have to either program 'IN C' for a target that has graphics functionality, which DOS does not!, and plan for Windows using Windows own functions.
Or you could, every bit I've already said, download a more modernistic graphics library for "C/C++", and employ the functions in it, such as the Allegro library, which tin can be found here

**cleaved link removed**

and is for C/C++

Everything I've suggested is using C/C++!!!

Bythe way, putpixel(x,y,color) is not ANSI C.

You lot tin can all the same use this function using the winbgi version of the library, but once more you're going to have to target windows with your plan.

  • #7

echo47

Advanced Member level 5
Joined
April seven, 2002
Messages
iii,942
Helped
638
Reputation
1,274
Reaction score
89
Trophy points
1,328
Location
U.s.a.
Activity points
33,176
how to brandish epitome in c

Permit's all try to be friendly hither!

Hi nikhat_ahir, Which compiler and operating system are yous using? Xvi-color putpixel() sounds like old Turbo C and DOS.

The standard C and C++ languages don't have any built-in support for graphic. Graphics features are usually added to the compiler through special function libraries or calls into the operating system, and those techniques differ depending on your particular compiler and operating organisation.

  • #8
Joined
October 17, 2005
Letters
217
Helped
nine
Reputation
eighteen
Reaction score
four
Trophy points
ane,298
Activity points
two,156
c++ display picture

**cleaved link removed** is not a effective link

  • #9
Joined
Mar 17, 2008
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
bharat
Activity points
i,370
display image in c

hullo to all,
spcially erstwhile nick,
thanks for ur suggestions, but i have a news for u all.
i displayed a bmp paradigm using C language. no need of any advanced libraries for graphics support.
again, thanks for ur supports, i got my trouble solved.

bye,
nikhat ahir.

  • #10
c++ display graphics
http://www.talula.demon.co.uk/allegro/ is not a constructive link

yes it is!

Added after half-dozen minutes:

how-do-you-do to all,
spcially former nick,
thanks for ur suggestions, but i take a news for u all.
i displayed a bmp image using C language. no need of any advanced libraries for graphics support.
once more, thanks for ur supports, i got my problem solved.

bye,
nikhat ahir.


You were request for assist with putpixel, wanting to brandish more than xvi colours. For that y'all needed to use a library more modernistic than the old borland graphics.h i.
Y'all now accept solved your problenm by loading a bitmap prototype. For this y'all wiull have had to use a library exactly the same every bit y'all would take for using a putpixel(). They are both utilising C language, which you seem to take some difficulty distinguishing.
Y'all should attempt and think about your questions more advisedly in hereafter as the solution you have told us about is not a solution to the question you asked in your commencement posts.
  • #eleven
Joined
Mar 17, 2008
Messages
vii
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
republic of india
Activeness points
ane,370
how to display an image in c

hi,
my question was:
"i want to display bitmap paradigm using c or c++.
i m getting problem with putpixel(x,y,color) function, as it takes merely upto 15 for colour statement.
is there any other mode to display image in C or C++?....."

and so, where did i tell that i want to display paradigm using putpixel merely? i had asked about whatsoever other possible way.
and one of the possible way is to apply "pointer". u can display image using pointer. u even do non need exercise use putpixel, nor u need graphics.h, standard one or modern one, nor u need any advance functions.

i was clear with my question. and, at present clear with my answer. i can brandish epitome using pointer in C. i even practice non need to use java, matlab, vc or some thing else, nor i need to apply any advance library.

so, please, dont get me wrong, my friend. because, i cant put my question in a better way than i did. if u know any better fashion, ur most welcome.

once more, thanks,
nikhat ahir.

  • #12

echo47

Advanced Member level v
Joined
Apr 7, 2002
Messages
3,942
Helped
638
Reputation
1,274
Reaction score
89
Bays points
1,328
Location
Us
Activity points
33,176
display images in c++

The standard C language does non have whatsoever graphics functions. Your graphics functions (such as putpixel) are probably located in a special graphics library that was bundled with your compiler. That library knows how to directly access the graphics controller, or how to call the operating organisation or device commuter to do drawing functions.

Information technology'southward difficult to answer your original question without knowing which compiler and operating system you are using. If information technology'due south an old environment such every bit DOS, then graphics brandish methods may depend on the type of graphics bill of fare you lot've installed.

  • #13
Joined
October 29, 2007
Letters
35
Helped
fifteen
Reputation
30
Reaction score
8
Trophy points
ane,288
Action points
1,451
how to brandish graphics in c++

You lot tin can employ OpenGL library functions for this purpose....

  • #14
Joined
Apr 20, 2002
Messages
71
Helped
four
Reputation
8
Reaction score
one
Trophy points
1,288
Activity points
236
  • #15
Joined
Mar 17, 2008
Messages
vii
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
india
Activity points
1,370
show epitome c++

hi,
no demand of using opencv or openGL or anything else. i got solution using POINTER only.
if i have to use OpenGL, then in that location r many alternatives, like as vc, java... and the almost user-friendly mode, as per me, is to use Matlab. simply, my problem is different one.
but, now, it has been solved.

again thanks to u all,
nikhat ahir.

  • #16
Joined
Aug five, 2008
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activeness points
1,284
display images in c

hi nikhat_ahir,

can you please write here your program with your solution?

  • #17
Joined
Jun 11, 2008
Letters
fourscore
Helped
nine
Reputation
eighteen
Reaction score
2
Bays points
1,288
Activeness points
1,711
brandish image using c++

plz utilise the command in MATLAB imread() to read the image from work directory. and imshow() to bear witness or display the paradigm.

I recall MATLAB is more handy with doing Image Processing and filtering in both spacial and frequency domain.
It has like symtax as C or C++

  • #18
Joined
October seven, 2008
Messages
i
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activeness points
1,284
displaying images in c++

Hi nikhat_ahir..

Will u please paste ur code hither. I m eager to knw hw u did that by using pointers.

  • #nineteen
Joined
Oct 20, 2008
Messages
96
Helped
8
Reputation
16
Reaction score
6
Trophy points
1,288
Activity points
1,648
display images c++

howdy, its very easy, use the arrow accost, for bmp read and directly write to grapichs card dac input.

  • #20
Joined
Apr 28, 2010
Messages
one
Helped
0
Reputation
0
Reaction score
0
Trophy points
one,281
Activity points
i,285
Hi nikhat_ahir

yep u r right.. bitmap images can b displayed in C northward no new graphics library or annihilation more than is required.. only i want to inquire u if u hav displayed an paradigm of more than 16 bit colors... if and then den plz permit me know how u did it.

Status
Not open for further replies.

Similar threads

  • Digital Design and Embedded Programming
  • Digital Signal Processing

Source: https://www.edaboard.com/threads/how-to-display-an-image-using-c-or-c.122123/

Posted by: hopkinsmorgilizeed.blogspot.com

0 Response to "How To Display Image In C# Windows Application"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel