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 » StreamRaster::LoadAnyFile -- not exist in distribution?
BugQuestion.gif  StreamRaster::LoadAnyFile -- not exist in distribution? [message #5626] Fri, 06 October 2006 13:04 Go to next message
temer is currently offline  temer
Messages: 5
Registered: October 2006
Location: Kyiv, Ukraine
Promising Member

I can not find out how to use this function in my code. I've tried to compile U++ example from U++ website and it writes that there is no StreamRaster::LoadAnyFile. Indeed, both "StreamRaster" and "LoadAnyFile" are absent in distribution. How can this happen? How can I use this function?

Thanks.

The example code follows:

#include <CtrlLib/CtrlLib.h>

 

struct MyApp : public TopWindow {

    Image   img;

    FileSel fs;

 

    void Open();

 

    virtual void Paint(Draw& w);

    virtual void LeftDown(Point, dword) { Open(); }

    

    typedef MyApp CLASSNAME;

    MyApp();

};

 

MyApp::MyApp()

{

    fs.Type("Image file", "*.bmp;*.png;*.tif;*.tiff;*.jpg;*.jpeg;*.gif");

    Sizeable();

}

 

void MyApp::Paint(Draw& w)

{

    w.DrawRect(GetSize(), White);

    if(img)

        w.DrawImage(0, 0, img);

    else

        w.DrawText(0, 0, "No image loaded!", Arial(30).Italic());

}

 

void MyApp::Open()

{

    if(fs.ExecuteOpen("Choose the image file to open")) {

        img = StreamRaster::LoadFileAny(~fs);

        Refresh();

    }

}

 

GUI_APP_MAIN

{

    MyApp app;

    app.Open();

    app.Run();

}

Re: StreamRaster::LoadAnyFile -- not exist in distribution? [message #5632 is a reply to message #5626] Fri, 06 October 2006 16:27 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Sorry, web-based documentation is a little bit ahead of time, you need "dev" version to have LoadAnyFile...
They are usually quite stable - used for production software, plus you will help betatesting for next "major" release.

[Updated on: Fri, 06 October 2006 16:29]

Report message to a moderator

Re: StreamRaster::LoadAnyFile -- not exist in distribution? [message #5635 is a reply to message #5632] Fri, 06 October 2006 18:17 Go to previous messageGo to next message
temer is currently offline  temer
Messages: 5
Registered: October 2006
Location: Kyiv, Ukraine
Promising Member

OK, I've downloaded dev version and it's there.

Could you, please, help me with the following?

I want to insert a smiley (.gif file from disk) to rich text view. How do I do it? I'm stucked.

I can make QtfRichObject from vector Drawing with usage of CreateDrawingObject(), but I want to use raster smileys, not vector one.
And I can't see how to make a QtfRichObject from an Image.



So, I have

Image img = StreamRaster::LoadFileAny("c:\\385.gif");

and I want to add its contents to a RichTextView1.



And the last, is it possible to use animated images in RichTextView? Probably, not Sad.

Thank you in advance.
Re: StreamRaster::LoadAnyFile -- not exist in distribution? [message #5639 is a reply to message #5635] Fri, 06 October 2006 20:33 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
temer wrote on Fri, 06 October 2006 12:17

OK, I've downloaded dev version and it's there.

Could you, please, help me with the following?

I want to insert a smiley (.gif file from disk) to rich text view. How do I do it? I'm stucked.

I can make QtfRichObject from vector Drawing with usage of CreateDrawingObject(), but I want to use raster smileys, not vector one.
And I can't see how to make a QtfRichObject from an Image.



So, I have

Image img = StreamRaster::LoadFileAny("c:\\385.gif");

and I want to add its contents to a RichTextView1.



And the last, is it possible to use animated images in RichTextView? Probably, not Sad.

Thank you in advance.



#include <CtrlLib/CtrlLib.h>

RichObject CreateImageObject(const Image& img)
{
	return RichObject("image", StoreImageAsString(img));
}

GUI_APP_MAIN
{
	QtfRichObject pict(CreateImageObject(StreamRaster::LoadFileAny("d:/jachym.bmp")));
	String qtf;
	qtf << "[A6 This is some drawing in QTF: " << pict << "&";
	qtf << "[C3*@B And now in the table: {{1:1 " << pict << ":: Another cell " << pict << "}}";
	PromptOK(qtf);
}


Anyway, as this is quite common request, I have added CreateImageObject to RichText package....
Re: StreamRaster::LoadAnyFile -- not exist in distribution? [message #5640 is a reply to message #5639] Fri, 06 October 2006 20:42 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
P.S.: No animated RichObjects yet, sorry...
Re: StreamRaster::LoadAnyFile -- not exist in distribution? [message #5671 is a reply to message #5640] Mon, 09 October 2006 09:52 Go to previous messageGo to next message
temer is currently offline  temer
Messages: 5
Registered: October 2006
Location: Kyiv, Ukraine
Promising Member

Thank you, Mirek!

Oops. Forget it.

I guess, I will do the animated pictures in the RichView as soon as I become familiar with U++.

[Updated on: Mon, 09 October 2006 09:59]

Report message to a moderator

Re: StreamRaster::LoadAnyFile -- not exist in distribution? [message #5806 is a reply to message #5626] Tue, 17 October 2006 15:40 Go to previous messageGo to next message
Larva is currently offline  Larva
Messages: 2
Registered: October 2006
Junior Member
This is a bmp file
http://www.stud.u-szeged.hu/Czetenyi.Laszlo.Kristof/8DBCF02B27.bmp
that i wanted to see with this image viewer. But the result is this:
http://www.stud.u-szeged.hu/Czetenyi.Laszlo.Kristof/what.jpg

What shoulld i do with the code to see my bmp in original form?
Re: StreamRaster::LoadAnyFile -- not exist in distribution? [message #5808 is a reply to message #5806] Tue, 17 October 2006 16:14 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Larva wrote on Tue, 17 October 2006 09:40

This is a bmp file
http://www.stud.u-szeged.hu/Czetenyi.Laszlo.Kristof/8DBCF02B27.bmp
that i wanted to see with this image viewer. But the result is this:
http://www.stud.u-szeged.hu/Czetenyi.Laszlo.Kristof/what.jpg

What shoulld i do with the code to see my bmp in original form?


There is quite a variety of .bmp formats, it looks like this one is unsupported variation. Will fix that ASAP.

Mirek
Re: StreamRaster::LoadAnyFile -- not exist in distribution? [message #5809 is a reply to message #5808] Tue, 17 October 2006 17:39 Go to previous messageGo to next message
Larva is currently offline  Larva
Messages: 2
Registered: October 2006
Junior Member
OK. Thank you.
Re: StreamRaster::LoadAnyFile -- not exist in distribution? [message #6264 is a reply to message #5809] Sun, 05 November 2006 09:08 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Fixed.

Mirek
Previous Topic: image of cursor
Next Topic: saving a paletted PNG
Goto Forum:
  


Current Time: Thu Mar 28 20:56:47 CET 2024

Total time taken to generate the page: 0.01437 seconds