Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: How to get a picture size


Message #1 by "Mark Roworth" <mark.roworth@b...> on Tue, 23 Jul 2002 18:08:20 +0100
GetBitmapdimensionex API is another way.

Desmond.


> This is a multi-part message in MIME format.

------=_NextPart_000_000C_01C23273.ED9C5A70
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

I have a picture stored in a DB in a Memo field. It may be a jpg or a bmp. 
I
want to find out it's size. I can reconstruct the file for it quite 
quickly.
However, the component that is trying to find the size is not a visual
component, but at the lowest level in my DB tier. Therefore I cannot load 
it
into a PictureBox or an Image control. Is there a data type I can load the
picture into to query it's size. Ideally, something like this:

Dim oPic as Fibble

Set oPic = New Fibble
set oPic.Picture = LoadPicture(cFilename)
MsgBox "Width = " & oPic.Width
MsgBox "Height = " & oPic.Height
Set oPic = Nothing

Any ideas anyone? Many thanks,

Mark Roworth
Dolphin Computing Ltd
www.dolphincomputing.co.uk
Phone: (UK) 01273 262865




------=_NextPart_000_000C_01C23273.ED9C5A70
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<META content=3D"MSHTML 6.00.2715.400" name=3DGENERATOR></HEAD>
<BODY>
<DIV><SPAN class=3D133100517-23072002><FONT face=3DArial size=3D2>I have =
a picture=20
stored in a DB in a Memo field. It may be a jpg or a bmp. I want to find =
out=20
it's size. I can reconstruct the file for it quite quickly. However, the =

component that is trying to find the size is not a visual component, but =
at the=20
lowest level in my DB tier. Therefore I cannot load it into a PictureBox =
or an=20
Image control. Is there a data type I can load the picture into to query =
it's=20
size. Ideally, something like this:</FONT></SPAN></DIV>
<DIV><SPAN class=3D133100517-23072002><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D133100517-23072002><FONT face=3D"Courier New" =
size=3D2>Dim oPic as=20
Fibble</FONT></SPAN></DIV>
<DIV><SPAN class=3D133100517-23072002><FONT face=3D"Courier New"=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D133100517-23072002><FONT face=3D"Courier New" =
size=3D2>Set oPic =3D=20
New Fibble</FONT></SPAN></DIV>
<DIV><SPAN class=3D133100517-23072002><FONT face=3D"Courier New" =
size=3D2>set=20
oPic.Picture =3D LoadPicture(cFilename)</FONT></SPAN></DIV>
<DIV><SPAN class=3D133100517-23072002><FONT face=3D"Courier New" =
size=3D2>MsgBox=20
"Width =3D " &amp; oPic.Width</FONT></SPAN></DIV>
<DIV><SPAN class=3D133100517-23072002><FONT face=3D"Courier New" =
size=3D2>MsgBox=20
"Height =3D " &amp; oPic.Height</FONT></SPAN></DIV>
<DIV><SPAN class=3D133100517-23072002><FONT face=3D"Courier New" =
size=3D2>Set oPic =3D=20
Nothing</FONT></SPAN></DIV>
<DIV><SPAN class=3D133100517-23072002><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D133100517-23072002><FONT face=3DArial size=3D2>Any =
ideas anyone?=20
Many thanks,</FONT></SPAN></DIV>
<DIV><SPAN class=3D133100517-23072002><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D133100517-23072002>
<P><FONT size=3D2>Mark Roworth<BR>Dolphin Computing=20
Ltd<BR>www.dolphincomputing.co.uk<BR>Phone: (UK) 01273 =
262865<BR>&nbsp;</FONT>=20
</P></SPAN></DIV>
<DIV><SPAN class=3D133100517-23072002><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_000C_01C23273.ED9C5A70--


  Return to Index