Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > C++ Programming
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
C++ Programming General discussions for the C++ language. For questions specific to Microsoft's Visual C++ variant, see the Visual C++ forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C++ Programming section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 7th, 2005, 06:58 AM
Authorized User
 
Join Date: May 2004
Location: Blackpool, Lancashire, United Kingdom.
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to sencee Send a message via AIM to sencee Send a message via MSN to sencee Send a message via Yahoo to sencee
Default Load Image from file to TPaintBox

I am trying to load an image from a OpenFile dialouge box, into a fixed size paint box, and am prooving very uncessessful.

I have managed to do exactly the same thing to load to a TImage structure, by using the following code.

Quote:
quote:
if (!dlgOpenImage -> Execute()) return;
imgDest->Picture->Bitmap->LoadFromFile(dlgOpenImage->FileName);
Which works fine, however when I try and use similar strategy for a TPaintBox it doens't want to know.

This is what I am currently working with

Quote:
quote:
void __fastcall TfrmMain::Fi1Click(TObject *Sender)
{
  //bool LoadImage = NULL;
  LoadImage = new Graphics::TBitmap;

  if (!dlgOpen->Execute()) return;
  pbxClientArea->Canvas->??;
  LoadImage->LoadFromFile(dlgOpen->FileName);

  LoadImage->Width=pbxClientArea->Width;
  LoadImage->Height=pbxClientArea->Height;

  TRect rect(0,0, LoadImagemage->Width, LoadImage->Height);
  //LoadImage->Canvas->Brush->Color=clWhite;
  LoadImage->Canvas->FillRect(rect);
}
where pbxClientArea is the destination paint box for the image to be loaded. and LoadImage is to be a residiual location for the dlgOpen file to be stored untill it is transfered to the paint box.

I dont know if i am going the correct way around it. Probably not.


.....HELP?

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i load a wmf image jerryham VB.NET 0 October 20th, 2008 12:55 PM
Handler to load an Image file -PDF Mehdi6002 BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 0 May 8th, 2007 09:00 AM
load a image from database pedrocosta24306 BOOK: Access 2003 VBA Programmer's Reference 0 January 5th, 2007 11:35 PM
Load image from URL JonnyRPI ASP.NET 1.0 and 1.1 Basics 0 June 9th, 2003 06:41 PM



All times are GMT -4. The time now is 05:43 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.