Problem with SaveImage

HARRY

Active Member
Licensed User
Longtime User
Hallo,

I am writing a small program that should draw a text into a BitmapEx and then save it into a file. After saving the result is an image file that just contains a black square. Drawing is successfull as the drawn text is shown in a ImageEx object.

Some details;

In the AppStart Sub:

FontDialog1.New1
NImage1.New1("PhotoText",25,75,200,200)
NameFont1.New1=FontName,FontSize,Style
Bitmap1.New2 (200,200)
Drawer1.New2(Bitmap1.Value)
Drawer1.Font=NameFont1.Value
TextBrush1.New1(ForeColor)

In the Draw Sub:

Bitmap1.Dispose 'To have each time a clean bitmap, necessary?
AddObject("Bitmap1","BitmapEx")
Bitmap1.New2 (200,200)
Drawer1.New2(Bitmap1.Value)
Drawer1.Font=NameFont1.Value
NImage1.Image = Bitmap1.Value
Drawer1.DrawString1(TBPhotoName.Text,TextBrush1.value,Left,Top)

In the Save Sub:

Bitmap1.SaveImage (SaveDialog1.File ,"J")

Of course there is some more code to set Left, Top, the writing color, etc..

What am I doing wrong?

Thanks for some help.

Harry



Sorry, sorry!

I was drawing black text on a black background and was mislead by the background color of the NImage control
 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…