473,320 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Graphics DrawImage() drawing a different size

I'm importing a jpeg via:

Bitmap* image = new Bitmap( filename ) ;

Then, using the Drawing::Graphics object, I execute DrawImage( image, x,
y ). My problem is that the original image was 200x200, but it's drawing
something smaller (something like 130x130, about 2/3 the original size). I
am using transforms, but I've verified that scaling is set to 1.0 on both x
and y axis.

What could be changing the drawing size from the bitmap original size?

[==P==]
Nov 17 '05 #1
3 2549
something to do with DPI perhaps?

"Peter Oliphant" <po*******@RoundTripInc.com> wrote in message
news:eL**************@TK2MSFTNGP09.phx.gbl...
I'm importing a jpeg via:

Bitmap* image = new Bitmap( filename ) ;

Then, using the Drawing::Graphics object, I execute DrawImage( image, x,
y ). My problem is that the original image was 200x200, but it's drawing
something smaller (something like 130x130, about 2/3 the original size). I
am using transforms, but I've verified that scaling is set to 1.0 on both
x and y axis.

What could be changing the drawing size from the bitmap original size?

[==P==]

Nov 17 '05 #2
> something to do with DPI perhaps?

I checked into that and no, that wasn't the problem in my particualr case
(but good idea). What it DID have to do with is my accidentally trying to
solve the problem in two places, which had a combined affect (i.e., it was
my mistake...hehe). It works fine now, even have the ability to scale and
rotate any image.

Now if only I could figure out how to get a TRUE transparent color to turn
an image into a 'sprite'. So far my attempts to make an image or bitmap
transparent has only result in making pixels of a certain color change to
the same color as the backcolor of the image's parent, which is not true
transparency. I've tried using MakeTransparent, and setting the backcolor to
the 'system transparent' color, and playing with TransparentKey. I've even
tried setting the backcolor to an alpha=0 color.

[==P==]

"Lloyd Dupont" <net.galador@ld> wrote in message
news:uP**************@TK2MSFTNGP09.phx.gbl...
something to do with DPI perhaps?

"Peter Oliphant" <po*******@RoundTripInc.com> wrote in message
news:eL**************@TK2MSFTNGP09.phx.gbl...
I'm importing a jpeg via:

Bitmap* image = new Bitmap( filename ) ;

Then, using the Drawing::Graphics object, I execute DrawImage( image, x,
y ). My problem is that the original image was 200x200, but it's drawing
something smaller (something like 130x130, about 2/3 the original size).
I am using transforms, but I've verified that scaling is set to 1.0 on
both x and y axis.

What could be changing the drawing size from the bitmap original size?

[==P==]


Nov 17 '05 #3
Once again, I'm a dummy. Got true transparancy to work using
MakeTransparent. Not sure why it now works, but coooool! : )

[==P==]

"Peter Oliphant" <po*******@RoundTripInc.com> wrote in message
news:Os**************@TK2MSFTNGP12.phx.gbl...
something to do with DPI perhaps?


I checked into that and no, that wasn't the problem in my particualr case
(but good idea). What it DID have to do with is my accidentally trying to
solve the problem in two places, which had a combined affect (i.e., it was
my mistake...hehe). It works fine now, even have the ability to scale and
rotate any image.

Now if only I could figure out how to get a TRUE transparent color to turn
an image into a 'sprite'. So far my attempts to make an image or bitmap
transparent has only result in making pixels of a certain color change to
the same color as the backcolor of the image's parent, which is not true
transparency. I've tried using MakeTransparent, and setting the backcolor
to the 'system transparent' color, and playing with TransparentKey. I've
even tried setting the backcolor to an alpha=0 color.

[==P==]

"Lloyd Dupont" <net.galador@ld> wrote in message
news:uP**************@TK2MSFTNGP09.phx.gbl...
something to do with DPI perhaps?

"Peter Oliphant" <po*******@RoundTripInc.com> wrote in message
news:eL**************@TK2MSFTNGP09.phx.gbl...
I'm importing a jpeg via:

Bitmap* image = new Bitmap( filename ) ;

Then, using the Drawing::Graphics object, I execute DrawImage( image, x,
y ). My problem is that the original image was 200x200, but it's drawing
something smaller (something like 130x130, about 2/3 the original size).
I am using transforms, but I've verified that scaling is set to 1.0 on
both x and y axis.

What could be changing the drawing size from the bitmap original size?

[==P==]



Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jeroen Ceuppens | last post by:
Hi, When i do this in my programma, in the contstructor of the form: g.DrawImage(i,new Rectangle(0,0,i.Width,i.Height),0,0,i.Width,i.Height,GraphicsUnit.Pixel); it doens't paint it ;( but if...
8
by: Mark Johnson | last post by:
Using: VS 2003 NET C# for Framework and Framework Compact Trying : Moving a Card (Bitmap) as in Solitare (PC + WinCe) Version on OnMouseMove Problem : The affected drawing Area by Invalidate (or...
2
by: Tamer Abdalla via DotNetMonster.com | last post by:
Hello, everyone! I DO need some help in order to understand how to create graphics in VB.NET. I'm a little bit confused... I once knew a time when using Point & PSet was almost the only way to...
1
by: placid | last post by:
Hi all, This is the following code i have, Public Class Form1 Inherits System.Windows.Forms.Form Dim A, B, c, U, x, y As Double Dim Red, Green, Blue As Integer
1
by: Frijoles | last post by:
Hello, I have a function that accepts an Image as the input. Currently, I load a bitmap in the calling class and pass that in. I'd like to create an overlay with another image and then pass the...
6
by: Blasting Cap | last post by:
I have to change the front page for a sales system I work on, and want to use some thumbnails of wallpaper that is on a sister site. The wallpapers are jpegs, and are 640, 800, 1024 & 1280 in...
7
by: rayreeves | last post by:
If I look for guidance on this topic I find simple examples like this: public class Form2:Form { public Form2() { this.Text = "FORM2"; this.Size = new Size(450,400); this.Paint += new...
9
by: koschwitz | last post by:
Hi, I hope you guys can help me make this simple application work. I'm trying to create a form displaying 3 circles, which independently change colors 3 times after a random time period has...
2
by: drsmooth | last post by:
Hi, i have made several different things using a double buffer and a jframe before but never had this problem: if you look thrugh the code, you can see that i draw a whole bunch of stuff to the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.