🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.multimedia
Article #465

Re: How to draw into a jpeg image

#465
From: Hans Galema
Date: Wed, 02 Jun 2004 09:13
39 lines
1997 bytes
Mario Sernicola wrote:

> Ok, so I've to continue convert JPG into a BMP with an external software,

No that has not been said.

> import the BMP in my TImage component, draw on it and finally import the JPG
> in TImage.

You can just make a bitmap yourself and draw the jpg on it.

Load the jpg in Image1 and place an extra TImage Image2 on your form:

  Graphics::TBitmap *bitmap = new Graphics::TBitmap;

  try
   {
    bitmap->Width  = Image1->Width;
    bitmap->Height = Image1->Height;

    bitmap->Canvas->Draw ( 0,0,Image1->Picture->Graphic);

    Image2->Picture->Bitmap->Assign ( bitmap );
     }
   catch ( Exception &exception )
      {
	//
      }

   delete bitmap;


> I need to draw on TImage canvas in order to catch vertex pixel of a polygon
> that describes a shape contained in TImage. When the vertex are know, I
> don't need BMP anymore.

You can use Image 2 for that. Or, even better, bitmap->Canvas.

Hans.
Technical Details
Message-ID: <40bd9a2b$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!controlnews3.google.com!news1.google.com!news.glorb.com!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <40bcd795$1@newsgroups.borland.com> <40bd02cb@newsgroups.borland.com> <40bd8664$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10d0fc,57413bdb9b690d15
X-Google-Attributes: gid10d0fc,public
Date: Wed, 02 Jun 2004 11:13:54 +0200
From: Hans Galema <dontusethis@dontusethis.nl>
User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.6b) Gecko/20031208
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.multimedia
Subject: Re: How to draw into a jpeg image
References: <40bcd795$1@newsgroups.borland.com> <40bd02cb@newsgroups.borland.com> <40bd8664$1@newsgroups.borland.com>
In-Reply-To: <40bd8664$1@newsgroups.borland.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 129.125.201.248
Message-ID: <40bd9a2b$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1086167595 129.125.201.248 (2 Jun 2004 02:13:15 -0700)
Lines: 39
Path: arc1-ca.pugleaf.net!controlnews3.google.com!news1.google.com!news.glorb.com!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail