🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: cn.bbs.comp.program
2 messages
2 total messages Started by haihandsome Wed, 22 Jul 1998 00:00
hDC Problem
#631
Author: haihandsome
Date: Wed, 22 Jul 1998 00:00
19 lines
1224 bytes
I Want to know a difference between type 1 & 2 ?? Why it difference ??
(I want to load bmp file to DC without load it to picture box)

Type 1 ...
Set picTemp.Picture = LoadPicture(FileName)
hdcX = CreateCompatibleDC(0&)
bmpX = CreateBitmap(Width, Height, cPlanes, cPixelBits, 0)
oldX = SelectObject(hdcX, bmpX)
BitBlt hdcX, 0, 0, Width, Height, picTemp.hdc, 0, 0, vbSrcCopy
Type 2 ...
Dim p As New StdPicture
Set p = LoadPicture(FileName)
hdcX = CreateCompatibleDC(0&)
oldX = SelectObject(hdcX, p.Handle)



-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum
Re: hDC Problem
#648
Author: Jia H
Date: Fri, 24 Jul 1998 00:00
26 lines
1444 bytes
For 1:    You create a new bitmap (bmpX) and connect it with the hdcX, after
use it you need disconnect it and release the object.
For 2:    You connect an exist bitmap (p) with the hdcX, after use it you
only need disconnect it.

haihandsome@my-dejanews.com wrote in message
<6p5bb8$8a7$1@nnrp1.dejanews.com>...
>I Want to know a difference between type 1 & 2 ?? Why it difference ??
>(I want to load bmp file to DC without load it to picture box)
>
>Type 1 ...
>Set picTemp.Picture = LoadPicture(FileName)
>hdcX = CreateCompatibleDC(0&)
>bmpX = CreateBitmap(Width, Height, cPlanes, cPixelBits, 0)
>oldX = SelectObject(hdcX, bmpX)
>BitBlt hdcX, 0, 0, Width, Height, picTemp.hdc, 0, 0, vbSrcCopy
>Type 2 ...
>Dim p As New StdPicture
>Set p = LoadPicture(FileName)
>hdcX = CreateCompatibleDC(0&)
>oldX = SelectObject(hdcX, p.Handle)
>
>
>
>-----== Posted via Deja News, The Leader in Internet Discussion ==-----
>http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads