Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » Why BMPEncoder::NewBmp() doesn´t exists anymoe?
Why BMPEncoder::NewBmp() doesn´t exists anymoe? [message #12950] Fri, 30 November 2007 10:15 Go to next message
alex100 is currently offline  alex100
Messages: 118
Registered: November 2007
Experienced Member
I am trying to ooad a bmp image from disk. Whe the line:

Image k=BMPEncoder::NewBmp()->LoadImageFile("OffIMG.bmp");

is compiled the compiler presents the error:

(...) error: `NewBmp' is not a member of `Upp::BMPEncoder'

Which is the easy way to load a bmp image from disk into a Image type variable? Source code would be appreciated.

Many thanks

Alex
Re: Why BMPEncoder::NewBmp() doesn´t exists anymoe? [message #12951 is a reply to message #12950] Fri, 30 November 2007 10:27 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

Image k = LoadImage("OffIMG.bmp")
Re: Why BMPEncoder::NewBmp() doesn´t exists anymoe? [message #12953 is a reply to message #12951] Fri, 30 November 2007 10:50 Go to previous messageGo to next message
alex100 is currently offline  alex100
Messages: 118
Registered: November 2007
Experienced Member
Do you mean:

Image k = ::LoadImageFromString(GetExeDirFile("Bruma.bmp"));

?


tab1.labelNumero.SetImage(k);
tab1.labelNumero.Refresh();


LoadImageFromString always return NULL ...


Any help?

Alex

Re: Why BMPEncoder::NewBmp() doesn´t exists anymoe? [message #12955 is a reply to message #12953] Fri, 30 November 2007 11:47 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Image k = StreamRaster::LoadFileAny(path);

Is what I use.
Re: Why BMPEncoder::NewBmp() doesn´t exists anymoe? [message #12960 is a reply to message #12953] Fri, 30 November 2007 14:36 Go to previous messageGo to next message
mr_ped is currently offline  mr_ped
Messages: 825
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor
alex100: why "from string"?
I think that function does expect the data of image to be in the string passed as argument, while you are giving it the name of file, not the data.

(but I didn't check the code or documentation, so I may be wrong)
Re: Why BMPEncoder::NewBmp() doesn´t exists anymoe? [message #12982 is a reply to message #12960] Mon, 03 December 2007 00:34 Go to previous messageGo to next message
alex100 is currently offline  alex100
Messages: 118
Registered: November 2007
Experienced Member
Cant load jpg images using that code Sad


Image k = StreamRaster::LoadFileAny(GetExeDirFile("1025.jpg"));
if(k==Null)
{
PromptOK("NULL received");
}
This doeanst load the image. Returns null but the file exists in the exe directory



This code:

Image k = StreamRaster::LoadFileAny(GetExeDirFile("foto1.png"));
if(k==Null)
{
PromptOK("NULL received");
}
Works well, why?


Thanks

Alex
Re: Why BMPEncoder::NewBmp() doesn´t exists anymoe? [message #12983 is a reply to message #12982] Mon, 03 December 2007 00:54 Go to previous messageGo to next message
zsolt is currently offline  zsolt
Messages: 693
Registered: December 2005
Location: Budapest, Hungary
Contributor
Add plugin/jpg package to your app.
Re: Why BMPEncoder::NewBmp() doesn´t exists anymoe? [message #12985 is a reply to message #12983] Mon, 03 December 2007 08:34 Go to previous message
alex100 is currently offline  alex100
Messages: 118
Registered: November 2007
Experienced Member
Oopsss...

It works now....

Thank you


Alex
Previous Topic: image drawn in Paint(Draw &w) does not stay when refereshed
Next Topic: flicker
Goto Forum:
  


Current Time: Thu Mar 28 18:32:41 CET 2024

Total time taken to generate the page: 0.01150 seconds