BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Strange PixelFormat behavior, anyone can help?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Graphics)
View previous topic :: View next topic  
Author Message
Ruby
Guest





PostPosted: Sun Jul 27, 2003 4:16 pm    Post subject: Strange PixelFormat behavior, anyone can help? Reply with quote




Hi,

My application got this global -

Graphics::TBitmap *TempPic;

on my OnClick event for a SpeedButton i have this -

TempPic = new Graphics::TBitmap();
TempPic->PixelFormat = pf24bit;

Now i don't know why, but "TempPic->PixelFormat" stays zero and
don't want to change into pf24bit (which should be 6). even if i
write this -

TempPic->PixelFormat = 6;

or even this -

TempPic->PixelFormat = 1;

and i check the value of "TempPic->PixelFormat", it's still 0!

Why does it not changing to what i ask it to?

Thanks for any help :-)

Ruby

Back to top
Maynard Philbrook
Guest





PostPosted: Sun Jul 27, 2003 4:53 pm    Post subject: Re: Strange PixelFormat behavior, anyone can help? Reply with quote



becuase you have not yet set the any size to the bitmap.
there for it does not yet exists.
i think after you do a set on the width and Height you may see your
change.


Ruby wrote:

Quote:
Hi,

My application got this global -

Graphics::TBitmap *TempPic;

on my OnClick event for a SpeedButton i have this -

TempPic = new Graphics::TBitmap();
TempPic->PixelFormat = pf24bit;

Now i don't know why, but "TempPic->PixelFormat" stays zero and
don't want to change into pf24bit (which should be 6). even if i
write this -

TempPic->PixelFormat = 6;

or even this -

TempPic->PixelFormat = 1;

and i check the value of "TempPic->PixelFormat", it's still 0!

Why does it not changing to what i ask it to?

Thanks for any help :-)

Ruby

--
To See what real programmers do in their spare time visit
http://jamie12.home.mindspring.com
home of PC bit software ..
Please send comments about my work .



Back to top
Ananth B.
Guest





PostPosted: Mon Jul 28, 2003 5:47 am    Post subject: Re: Strange PixelFormat behavior, anyone can help? Reply with quote



Hi Ruby,
You will need to load some data into the picture before u change its
PixelFormat. Maybe thats the problem here ?

--
Hope this helps,

Regards,
Ananth B.

Back to top
Ruby
Guest





PostPosted: Mon Jul 28, 2003 8:29 am    Post subject: Re: Strange PixelFormat behavior, anyone can help? Reply with quote


Hi Ananth, thanks, but i don't think that this is the problem.

First, on the same computer (it's using Win-2000) i'm having
another project with the same lines of code exactly, and there
it's working very well, i could not find ANY differents between
this 2 sources, i also looked at the h files, which also looks
exactly the same, i even took the cpp source that is working,
and i Cut-Pasted it to the other project, and it's still not
working...

Second, i don't think that i need to load data into the Bitmap
before i'm setting it's PixelFormat, i just set it's Width and
Height, than it's PixelFormat, for using it as a memory Bitmap
which i drow on and than copy to the form's canvas.

Here is the source again, but i think that the problem is not
here but some place else...

What do you think?

Here is my last code -

#include <vcl.h>
#pragma hdrstop
#include "Animation.h"
#pragma package(smart_init)
#pragma resource "*.dfm"

TForm1 *Form1;

Graphics::TBitmap *TempPic;
int i;

__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
TempPic = new Graphics::TBitmap();

TempPic->Width = 50;
TempPic->Height = 50;
TempPic->PixelFormat = pf24bit; // But it's stays zero...
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

"Ananth B." <ananth__b-at-hotmail.com> wrote:
Quote:
Hi Ruby,
You will need to load some data into the picture before u change its
PixelFormat. Maybe thats the problem here ?

--
Hope this helps,

Regards,
Ananth B.



Back to top
Ruby
Guest





PostPosted: Tue Jul 29, 2003 10:09 am    Post subject: Re: Strange PixelFormat behavior, anyone can help? Reply with quote


Hi Ananth, are you still here?

I have found the solution! but i still can't understand it...
Maybe you can explain it, or anyone else...

On my project options i had this -

Project->Options->Linker tab->"Use dynamic RTL" = true (checked)

Project->Options->Packages tab->"Build with runtime packages" =
true (checked)

This way i had the problem...

But after i changed it to this -

Project->Options->Linker tab->"Use dynamic RTL" = false
(unchecked)

Project->Options->Packages tab->"Build with runtime packages" =
false (unchecked)

Then suddenly it was OK! Smile (this is what i also had in the
code that was working)

How do you explain this strange thing?

Ruby.

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Graphics) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.