Connecting Tech Pros Worldwide Help | Site Map

dynamic TImage component creation

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 19th, 2005, 05:28 PM
macbul
Guest
 
Posts: n/a
Default dynamic TImage component creation


(C++ Builder 6.0 enterprise)



I tried to create a TImage component by using this source code:



// ---

TImage *Image = new TImage (Application);

Image->Picture->LoadFromFile ("a.bmp");

// ---



There are no errors, but the image does not apear on the form. I also
tried setting properties, like: Left, Top, Height, Width, Visible, but
that didn't change anything.



Maybe I'm doing something wrong or I'm forgeting to do something. I
would be thankful for helping me out.



Maciej Bulaszewski, Poland


--
Posted via http://dbforums.com

  #2  
Old July 19th, 2005, 05:28 PM
Ivan Vecerina
Guest
 
Posts: n/a
Default Re: dynamic TImage component creation [OT]

"macbul" <member39439@dbforums.com> wrote in message
news:3366858.1063475336@dbforums.com...[color=blue]
> (C++ Builder 6.0 enterprise)[/color]

Note: this is out of topic here.
Some will flame you for being OT, but most importantly
your chances of getting a helpful answer are much slimmer
than on a dedicated NG ( i.e. borland...., see their web site).
[color=blue]
> TImage *Image = new TImage (Application);
>
> Image->Picture->LoadFromFile ("a.bmp");[/color]
....[color=blue]
> There are no errors, but the image does not apear on the form. I also
> tried setting properties, like: Left, Top, Height, Width, Visible, but
> that didn't change anything.[/color]

You probably need to create the Image within a specific Form,
not as a child of the Application object...


Regards,
--
http://www.post1.com/~ivec <> Ivan Vecerina


  #3  
Old July 19th, 2005, 05:29 PM
Duane Hebert
Guest
 
Posts: n/a
Default Re: dynamic TImage component creation [OT]


"Ivan Vecerina" <ivecATmyrealboxDOTcom> wrote in message
news:3f6360dc@news.swissonline.ch...[color=blue]
> "macbul" <member39439@dbforums.com> wrote in message
> news:3366858.1063475336@dbforums.com...[color=green]
> > (C++ Builder 6.0 enterprise)[/color]
>
> Note: this is out of topic here.
> Some will flame you for being OT, but most importantly
> your chances of getting a helpful answer are much slimmer
> than on a dedicated NG ( i.e. borland...., see their web site).
>[color=green]
> > TImage *Image = new TImage (Application);
> >
> > Image->Picture->LoadFromFile ("a.bmp");[/color]
> ...[color=green]
> > There are no errors, but the image does not apear on the form. I also
> > tried setting properties, like: Left, Top, Height, Width, Visible, but
> > that didn't change anything.[/color]
>
> You probably need to create the Image within a specific Form,
> not as a child of the Application object...[/color]

Not sure about TImeage but most VCL visual stuff requires an owner and a
parent.
Also, LoadFromFile() probably throws on failure so you would need a
try/catch to handle
errors.

TImage *Image = new TImage (Application);
Image->Parent = this; // or wherever you want the bitmap
try{
Image->Picture->LoadFromFile ("a.bmp")
} catch(Exception &spoo) {
//whatever on failure
}

This is the wrong place for this question though. Try
newsgroups.borland.com and subscribe to
borland.public.cppbuilder.vcl.components.using


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.